Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PKG] SQLite #57

Closed
Zingam opened this issue Jan 19, 2020 · 2 comments
Closed

[PKG] SQLite #57

Zingam opened this issue Jan 19, 2020 · 2 comments
Labels
package request Requests for new packages to be added to the corpus.

Comments

@Zingam
Copy link

Zingam commented Jan 19, 2020

Package name
SQLite

Package URL
https://www.sqlite.org/index.html

Package source location
https://www.sqlite.org/download.html

@Zingam Zingam added the package request Requests for new packages to be added to the corpus. label Jan 19, 2020
@atkawa7
Copy link

atkawa7 commented Mar 3, 2020

@Zingam In the meantime there is feature that was created microsoft/vcpkg#10271. You can build the archive yourself. Its easy

apply patch to enable android sqlite

diff --git a/ports/sqlite3/CMakeLists.txt b/ports/sqlite3/CMakeLists.txt
index 64ff00262..3e5ac4daf 100644
--- a/ports/sqlite3/CMakeLists.txt
+++ b/ports/sqlite3/CMakeLists.txt
@@ -3,7 +3,7 @@ project(sqlite3 C)

 include_directories(.)
 if(BUILD_SHARED_LIBS)
-    if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
+    if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "Android")
         set(API "-DSQLITE_API=__attribute__((visibility(\"default\")))")
     elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
         set(API "-DSQLITE_API=__declspec(dllexport)")
diff --git a/ports/sqlite3/portfile.cmake b/ports/sqlite3/portfile.cmake
index e46036667..bc930311b 100644
--- a/ports/sqlite3/portfile.cmake
+++ b/ports/sqlite3/portfile.cmake
@@ -25,6 +25,7 @@ vcpkg_configure_cmake(
     SOURCE_PATH ${SOURCE_PATH}
     PREFER_NINJA
     OPTIONS ${FEATURE_OPTIONS}
+    -DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}
     OPTIONS_DEBUG
         -DSQLITE3_SKIP_TOOLS=ON
 )
export ANDROID_NDK_HOME="/Library/Android/sdk/ndk/<version>"
./vcpkg install sqlite3  --triplet x86-android
./vcpkg install sqlite3  --triplet x64-android
./vcpkg install sqlite3  --triplet arm-android
./vcpkg install sqlite3  --triplet arm64-android
./vcpkg export sqlite3  --triplet x86-android --prefab

The resulting pom

    <groupId>com.vcpkg.ndk.support</groupId>
    <artifactId>sqlite3</artifactId>
    <version>3.30.1-2</version>
    <packaging>aar</packaging>

or Gradle

  implementation "com.vcpkg.ndk.support:sqlite3:3.30.1-2"

@leleliu008
Copy link

leleliu008 commented Aug 12, 2023

The vcpkg export as aar feature had broken for at least half a year.

This package had been publish to my maven repository hosted on github https://github.com/leleliu008/ndk-pkg-prefab-aar-maven-repo

You’re welcome to give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package request Requests for new packages to be added to the corpus.
Projects
None yet
Development

No branches or pull requests

4 participants