diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2022-10-25 09:50:40 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2022-10-25 09:50:40 -0400 |
commit | 9a9b023e120b1919ba06e150ba4b345cefdd1765 (patch) | |
tree | 31b0e2ee64acdc2338ee63286b43b9e7a64692f8 | |
parent | 49bae736fc589a4a82cfeab1e73e3a9db650f190 (diff) | |
download | lite-xl-plugin-manager-9a9b023e120b1919ba06e150ba4b345cefdd1765.tar.gz lite-xl-plugin-manager-9a9b023e120b1919ba06e150ba4b345cefdd1765.zip |
Making build.sh more compatible with older cmakes. Also, fixed some issues when system lite-xl is not found.
-rwxr-xr-x | build.sh | 6 | ||||
-rw-r--r-- | src/lpm.lua | 5 |
2 files changed, 7 insertions, 4 deletions
@@ -22,11 +22,11 @@ if [[ "$@" != *"-lssl"* && "$@" != *"-lcrypto"* ]]; then LDFLAGS="$LDFLAGS -Llib/libz/build" && CFLAGS="$CFLAGS -Ilib/prefix/include" && LDFLAGS="$LDFLAGS -Llib/prefix/lib -Llib/prefix/lib64 -l:libssl.a -l:libcrypto.a" fi if [[ "$@" != *"-lgit2"* ]]; then - [ ! -e "lib/libgit2/build" ] && cd lib/libgit2 && mkdir build && cd build && cmake .. -G="Unix Makefiles" $GIT2_CONFIGURE -DCMAKE_PREFIX_PATH=`pwd`/../../prefix -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DOPENSSL_ROOT_DIR=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_CLI=OFF -DREGEX_BACKEND=builtin -DUSE_SSH=OFF && $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/libgit2/build" ] && cd lib/libgit2 && mkdir build && cd build && cmake .. -G "Unix Makefiles" $GIT2_CONFIGURE -DCMAKE_PREFIX_PATH=`pwd`/../../prefix -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DOPENSSL_ROOT_DIR=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_CLI=OFF -DREGEX_BACKEND=builtin -DUSE_SSH=OFF && $MAKE -j $JOBS && $MAKE install && cd ../../../ LDFLAGS="-Llib/libgit2/build -l:libgit2.a $LDFLAGS -Llib/prefix/lib -Llib/prefix/lib64" && CFLAGS="$CFLAGS -Ilib/prefix/include" fi if [[ "$@" != *"-lcurl"* ]]; then - [ ! -e "lib/curl/build" ] && cd lib/curl && mkdir build && cd build && cmake .. -G="Unix Makefiles" $CURL_CONFIGURE -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAPS=ON -DUSE_OPENSSL=ON -DCURL_DISABLE_LDAP=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DUSE_LIBIDN2=OFF -DENABLE_UNICODE=OFF -DBUILD_CURL_EXE=OFF -DCURL_USE_LIBSSH2=OFF -DOPENSSL_ROOT_DIR=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib && $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/curl/build" ] && cd lib/curl && mkdir build && cd build && cmake .. -G "Unix Makefiles" $CURL_CONFIGURE -DCURL_USE_LIBPSL=OFF -DCURL_DISABLE_LDAPS=ON -DUSE_OPENSSL=ON -DCURL_DISABLE_LDAP=ON -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DUSE_LIBIDN2=OFF -DENABLE_UNICODE=OFF -DBUILD_CURL_EXE=OFF -DCURL_USE_LIBSSH2=OFF -DOPENSSL_ROOT_DIR=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_LIBDIR=lib && $MAKE -j $JOBS && $MAKE install && cd ../../../ LDFLAGS="-Llib/curl/build -Llib/prefix/lib -l:libcurl.a $LDFLAGS" && CFLAGS="$CFLAGS -Ilib/prefix/include -DCURL_STATICLIB" fi if [[ "$@" != *"-llzma"* ]]; then @@ -34,7 +34,7 @@ if [[ "$@" != *"-llzma"* ]]; then LDFLAGS="-Llib/liblzma/build -Llib/prefix/lib -l:liblzma.a $LDFLAGS" && CFLAGS="$CFLAGS -Ilib/prefix/include" fi if [[ "$@" != *"-larchive"* ]]; then - [ ! -e "lib/libarchive/build-tmp" ] && cd lib/libarchive && mkdir build-tmp && cd build-tmp && cmake .. -G="Unix Makefiles" $ARCHIVE_CONFIGURE -DZLIB_WINAPI_EXITCODE=0 -DENABLE_TEST=OFF -DZLIB_WINAPI_EXITCODE__TRYRUN_OUTPUT="test" -DENABLE_EXPAT=OFF -DENABLE_ACL=OFF -DENABLE_XATTR=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_BZip2=OFF -DENABLE_OPENSSL=OFF -DENABLE_LIBXML2=OFF -DENABLE_PCREPOSIX=OFF && $MAKE -j $JOBS && $MAKE install && cd ../../../ + [ ! -e "lib/libarchive/build-tmp" ] && cd lib/libarchive && mkdir build-tmp && cd build-tmp && cmake .. -G "Unix Makefiles" $ARCHIVE_CONFIGURE -DZLIB_WINAPI_EXITCODE=0 -DENABLE_TEST=OFF -DZLIB_WINAPI_EXITCODE__TRYRUN_OUTPUT="test" -DENABLE_EXPAT=OFF -DENABLE_ACL=OFF -DENABLE_XATTR=OFF -DCMAKE_INSTALL_PREFIX=`pwd`/../../prefix -DBUILD_SHARED_LIBS=OFF -DENABLE_CAT=OFF -DENABLE_CPIO=OFF -DENABLE_BZip2=OFF -DENABLE_OPENSSL=OFF -DENABLE_LIBXML2=OFF -DENABLE_PCREPOSIX=OFF && $MAKE -j $JOBS && $MAKE install && cd ../../../ [ ! -e "lib/prefix/lib/libarchive.a" ] && cp -f lib/prefix/lib/libarchive_static.a lib/prefix/lib/libarchive.a LDFLAGS="-Llib/libarchive/build-tmp -Llib/prefix/lib -l:libarchive.a $LDFLAGS" && CFLAGS="$CFLAGS -Ilib/prefix/include" fi diff --git a/src/lpm.lua b/src/lpm.lua index 238d5f9..4b1165a 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -509,6 +509,7 @@ function Plugin.new(repository, metadata) dependencies = {}, local_path = repository and (repository.local_path .. PATHSEP .. (repository.commit or repository.branch) .. (metadata.path and (PATHSEP .. metadata.path:gsub("^/", "")) or "")), }, metadata), Plugin) + self.type = type -- Directory. self.organization = metadata.organization or (((self.files and #self.files > 0) or self.remote or (not self.path and not self.url)) and "complex" or "singleton") return self @@ -1576,13 +1577,15 @@ Flags have the following effects: if not system_lite_xl then system_lite_xl = common.first(lite_xls, function(e) return e.version == "system" end) if system_lite_xl then error("can't find existing system lite (does " .. system_lite_xl.local_path .. " exist? was it moved?); run `lpm purge`, or resolve otherwise") end - system_lite_xl = LiteXL.new(nil, { path = directory, mod_version = 3, version = "system", tags = { "system", "local" } }) + system_lite_xl = LiteXL.new(nil, { path = directory, mod_version = MOD_VERSION or 3, version = "system", tags = { "system", "local" } }) table.insert(lite_xls, system_lite_xl) lpm_lite_xl_save() else table.insert(system_lite_xl.tags, "system") end system_bottle = Bottle.new(system_lite_xl, nil, true) + else + system_bottle = Bottle.new(LiteXL.new(nil, { mod_version = MOD_VERSION or 3, version = "system", tags = { "system", "local" } }), nil, true) end if not system_bottle then system_bottle = Bottle.new(nil, nil, true) end |