File tree Expand file tree Collapse file tree 7 files changed +65
-2
lines changed Expand file tree Collapse file tree 7 files changed +65
-2
lines changed Original file line number Diff line number Diff line change 11
2+ include config.mk
3+
4+ CFLAGS+="-std =c99"
5+ CFLAGS+ =$(JSON_C_CFLAGS )
6+ LDFLAGS+ =$(JSON_C_LDFLAGS )
7+
28json-search : json-search.o
3- $(CC ) -ljson-c -std=c99 -Wall -Wextra json-search.o -o json-search
9+ $(CC ) -ljson-c $(JSON_C_LDFLAGS ) -std=c99 -Wall -Wextra json-search.o -o json-search
10+
11+ appimagetool-x86_64.AppImage :
12+ wget https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage
13+ chmod +x appimagetool-x86_64.AppImage
14+
15+ json-search-x86_64.AppImage : json-search appimagetool-x86_64.AppImage
16+ mkdir -p json-search.AppDir/usr/
17+ mkdir -p json-search.AppDir/usr/bin/
18+ mkdir -p json-search.AppDir/usr/lib/
19+ cp json-search json-search.AppDir/usr/bin/
20+ ./cp_json-c.sh
21+ ./appimagetool-x86_64.AppImage json-search.AppDir
422
523clean :
624 rm json-search.o
Original file line number Diff line number Diff line change 1+
2+ JSON_C_CFLAGS =-I/usr/include/json-c
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ DIR=$PWD
4+ NO_RECOMPILE=1
5+
6+ echo " " > config.mk
7+ echo ' #!/bin/bash' > ./cp_json-c.sh
8+ chmod +x ./cp_json-c.sh
9+
10+ for arg in $@ ; do
11+ echo $( echo " $arg " | cut -d ' =' -f 1)
12+ if [ " --compile-json-c" = $arg ]; then
13+ git clone https://github.com/json-c/json-c.git
14+ mkdir json-c-build
15+ cd json-c-build
16+ cmake3 ../json-c/
17+ make
18+ cd -
19+ NO_RECOMPILE=0
20+ echo ' JSON_C_CFLAGS=-I./json-c -I./json-c-build' >> config.mk
21+ echo ' JSON_C_LDFLAGS="-L./json-c-build"' >> config.mk
22+ echo " cp json-c-build/libjson-c.so* json-search.AppDir/usr/lib/" >> ./cp_json-c.sh
23+ fi
24+ if [ " --help" = $arg ]; then
25+ echo " --compile-json-c: clone and compile json-c"
26+ fi
27+ done
28+
29+ if [ $NO_RECOMPILE -eq 1 ]; then
30+ echo JSON_C_CFLAGS=$( pkg-config --cflags json-c) >> config.mk
31+ echo " cp \$ (ldd json-search | grep json | cut -d ' ' -f 3) json-search.AppDir/usr/lib/" >> ./cp_json-c.sh
32+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ LD_LIBRARY_PATH=${APPDIR} /usr/lib/ " ${APPDIR} /usr/bin/json-search" " $@ "
Original file line number Diff line number Diff line change 1+ [Desktop Entry]
2+ Type =Application
3+ Name =json-search
4+ Exec =json-search
5+ Comment =grep into like, and format print
6+ Categories =Development;
7+ Terminal =true
8+ Icon =appimage-logo
Original file line number Diff line number Diff line change 1818#include <stdio.h>
1919#include <stdlib.h>
2020#include <string.h>
21- #include < json-c/json.h>
21+ #include " json.h"
2222
2323#define panic (...) \
2424 do { \
You can’t perform that action at this time.
0 commit comments