mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-11-03 21:17:33 +08:00
improve (gcc): static build
This commit is contained in:
@ -13,8 +13,12 @@ To test the libraries are working fine:
|
|||||||
# libtranscode:
|
# libtranscode:
|
||||||
gcc -Wall -c src/libtranscode_test.c
|
gcc -Wall -c src/libtranscode_test.c
|
||||||
gcc -o main_transcode.bin libtranscode_test.o -lm -lpthread -L. -l:libtranscode.a
|
gcc -o main_transcode.bin libtranscode_test.o -lm -lpthread -L. -l:libtranscode.a
|
||||||
|
curl -O https://archive.kerjean.me/public/2020/sample.CR2
|
||||||
|
./main_transcode.bin ./sample.CR2
|
||||||
|
|
||||||
# libresize:
|
# libresize:
|
||||||
gcc -Wall -c src/libresize_test.c `pkg-config --cflags glib-2.0`
|
gcc -Wall -c src/libresize_test.c `pkg-config --cflags glib-2.0`
|
||||||
gcc -o main_resize.bin libresize_test.o -lm -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -L. -l:libresize.a
|
gcc -o main_resize.bin libresize_test.o -lm -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -L. -l:libresize.a
|
||||||
|
curl -O https://archive.kerjean.me/public/2020/sample.jpg
|
||||||
|
./main_resize.bin ./sample.jpg
|
||||||
```
|
```
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <vips/vips.h>
|
|
||||||
|
|
||||||
int image_resize(const char *filename, void **buf, size_t *len, int size, int crop, int quality, int exif);
|
int image_resize(const char *filename, void **buf, size_t *len, int size, int crop, int quality, int exif);
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libraw/libraw.h>
|
|
||||||
|
|
||||||
int image_transcode_compute(const char* filename, int min_width);
|
int image_transcode_compute(const char* filename, int min_width);
|
||||||
|
|||||||
@ -4,8 +4,5 @@ set -e
|
|||||||
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
||||||
cd "$(dirname "$0")"/deps
|
cd "$(dirname "$0")"/deps
|
||||||
echo `pwd`
|
echo `pwd`
|
||||||
curl -s https://downloads.filestash.app/upload/libresize-linux-x86-64.a > libresize.a
|
curl -s https://downloads.filestash.app/upload/libresize_`uname -s`-`uname -m`.a > libresize.a
|
||||||
curl -Ls https://downloads.filestash.app/upload/libresize-linux-headers.tar.gz | tar zxf - -C /usr/local/include/
|
curl -s https://downloads.filestash.app/upload/libtranscode_`uname -s`-`uname -m`.a > libtranscode.a
|
||||||
|
|
||||||
curl -s https://downloads.filestash.app/upload/libtranscode-linux-x86-64.a > libtranscode.a
|
|
||||||
curl -Ls https://downloads.filestash.app/upload/libtranscode-linux-headers.tar.gz | tar zxf - -C /usr/local/include/
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package plg_image_light
|
|||||||
// #cgo CFLAGS: -I./deps/src
|
// #cgo CFLAGS: -I./deps/src
|
||||||
// #cgo LDFLAGS: -lm -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -ldl -L./deps -l:libresize.a
|
// #cgo LDFLAGS: -lm -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -ldl -L./deps -l:libresize.a
|
||||||
// #include "libresize.h"
|
// #include "libresize.h"
|
||||||
|
// #include "glib-2.0/glib.h"
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
Reference in New Issue
Block a user