Skip to content

Commit

Permalink
symlink libgovarnam -> libgovarnam.so.$SO_NAME (#39)
Browse files Browse the repository at this point in the history
* symlink libgovarnam.so -> libgovarnam.so.$SO_NAME

varnamcli looks for libgovarnam.so.SO_NAME and fails
to find any.

ldd varnamcli   | grep libgovarnam
	libgovarnam.so.1 => not found

2 cases

* make library: only libgovarnam.so is compiled,
	so symlink libgovarnam.so -> libgovarnam.so.SO_NAME
	for local varnamcli use.

* make install: symlink libgovarnam.so.VERSION -> libgovarnam.so.SO_NAME

* install: overwrite lib symlinks

install fails if symlinks exist, so overwrite it.
  • Loading branch information
anoop142 authored Nov 5, 2023
1 parent c98f431 commit f17a33a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ install-script:
${SED} "s#@INSTALL_PREFIX@#${INSTALL_PREFIX}#g" install.sh
${SED} "s#@VERSION@#${VERSION}#g" install.sh
${SED} "s#@LIB_NAME@#${LIB_NAME}#g" install.sh
${SED} "s#@SO_NAME@#${SO_NAME}#g" install.sh
chmod +x install.sh

install:
Expand All @@ -60,6 +61,7 @@ library-nosqlite:

library:
CGO_ENABLED=1 go build -tags "fts5" -buildmode=c-shared -ldflags "-s -w ${VERSION_STAMP_LDFLAGS}" -o ${LIB_NAME} .
ln -sf "$(realpath ./)/libgovarnam.so" "$(realpath ./)/libgovarnam.so.${SO_NAME}"

library-mac-universal:
GOOS=darwin GOARCH=arm64 $(MAKE) library
Expand Down
3 changes: 2 additions & 1 deletion install.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ if [ "$ARG1" == "install" ]; then

"${SUDO}" mkdir -p "@INSTALL_PREFIX@/lib/pkgconfig"
"${SUDO}" cp "$SCRIPT_DIR/@LIB_NAME@" "@INSTALL_PREFIX@/lib/@LIB_NAME@.@VERSION@"
"${SUDO}" ln -s "@INSTALL_PREFIX@/lib/@LIB_NAME@.@VERSION@" "@INSTALL_PREFIX@/lib/@LIB_NAME@"
"${SUDO}" ln -sf "@INSTALL_PREFIX@/lib/@LIB_NAME@.@VERSION@" "@INSTALL_PREFIX@/lib/@LIB_NAME@"
"${SUDO}" ln -sf "@INSTALL_PREFIX@/lib/@LIB_NAME@.@VERSION@" "@INSTALL_PREFIX@/lib/@LIB_NAME@.@SO_NAME@"
"${SUDO}" cp "$SCRIPT_DIR/govarnam.pc" "@INSTALL_PREFIX@/lib/pkgconfig/"

"${SUDO}" mkdir -p "@INSTALL_PREFIX@/include/libgovarnam"
Expand Down

0 comments on commit f17a33a

Please sign in to comment.