Add parted dependency (does not build yet)
This commit is contained in:
parent
7a95328bbd
commit
db9f81ea6a
7 changed files with 75 additions and 2 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -10,3 +10,6 @@
|
||||||
[submodule "app/src/c/libressl"]
|
[submodule "app/src/c/libressl"]
|
||||||
path = dmg2img/src/c/libressl
|
path = dmg2img/src/c/libressl
|
||||||
url = https://github.com/libressl-portable/portable.git
|
url = https://github.com/libressl-portable/portable.git
|
||||||
|
[submodule "parted/src/c/parted"]
|
||||||
|
path = parted/src/c/parted
|
||||||
|
url = https://github.com/Depau/parted.git
|
||||||
|
|
|
@ -37,7 +37,7 @@ dependencies {
|
||||||
// implementation 'com.github.mjdev:libaums:0.5.5'
|
// implementation 'com.github.mjdev:libaums:0.5.5'
|
||||||
implementation project(':libaums')
|
implementation project(':libaums')
|
||||||
implementation project(':dmg2img')
|
implementation project(':dmg2img')
|
||||||
|
implementation project(':parted')
|
||||||
|
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||||
|
|
43
parted/CMakeLists.txt
Normal file
43
parted/CMakeLists.txt
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
cmake_minimum_required(VERSION 3.4)
|
||||||
|
|
||||||
|
find_program(CCACHE_FOUND ccache)
|
||||||
|
if(CCACHE_FOUND)
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||||
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
||||||
|
endif(CCACHE_FOUND)
|
||||||
|
|
||||||
|
include(ExternalProject)
|
||||||
|
|
||||||
|
ExternalProject_Add(parted_build
|
||||||
|
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/c/parted"
|
||||||
|
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/src/c/parted/configure --prefix=<INSTALL_DIR> --sbindir=${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}/ --bindir=${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}/ --libdir=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
|
||||||
|
BUILD_COMMAND ${MAKE})
|
||||||
|
|
||||||
|
ExternalProject_Add_Step(parted_build bootstrap
|
||||||
|
DEPENDERS configure
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/c/parted
|
||||||
|
COMMAND ./bootstrap)
|
||||||
|
|
||||||
|
add_library(libparted-fs-resize SHARED IMPORTED)
|
||||||
|
add_dependencies(libparted-fs-resize parted_build)
|
||||||
|
set_target_properties(libparted-fs-resize PROPERTIES IMPORTED_LOCATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libparted-fs-resize.so.0.0.1)
|
||||||
|
|
||||||
|
add_library(libparted SHARED IMPORTED)
|
||||||
|
add_dependencies(libparted parted_build)
|
||||||
|
set_target_properties(libparted PROPERTIES IMPORTED_LOCATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libparted.so.2.0.1)
|
||||||
|
|
||||||
|
add_executable(parted IMPORTED)
|
||||||
|
add_dependencies(parted parted_build)
|
||||||
|
set_target_properties(parted PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}/parted)
|
||||||
|
|
||||||
|
add_executable(partprobe IMPORTED)
|
||||||
|
add_dependencies(partprobe parted_build)
|
||||||
|
set_target_properties(partprobe PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}/partprobe)
|
||||||
|
|
||||||
|
#ExternalProject_Add_Step(parted mkbindir
|
||||||
|
# DEPENDEES build
|
||||||
|
# COMMAND mkdir -p "${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}/")
|
||||||
|
|
||||||
|
#ExternalProject_Add_Step(parted copybin
|
||||||
|
# DEPENDEES mkbindir
|
||||||
|
# COMMAND cp <INSTALL_DIR>/sbin/parted <INSTALL_DIR>/sbin/partprobe "${CMAKE_CURRENT_SOURCE_DIR}/src/main/assets/bin/${ANDROID_ABI}/")
|
23
parted/build.gradle
Normal file
23
parted/build.gradle
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 28
|
||||||
|
defaultConfig {
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
targets "libparted", "libparted-fs-resize", "parted", "partprobe"
|
||||||
|
arguments "-DANDROID_PIE=ON"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
path "CMakeLists.txt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
assets.srcDirs = ['src/main/assets']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
parted/src/c/parted
Submodule
1
parted/src/c/parted
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 395f8aabfecb28820006d37ec37e9ffe1d2eb1e3
|
3
parted/src/main/AndroidManifest.xml
Normal file
3
parted/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="org.gnu.parted" >
|
||||||
|
</manifest>
|
|
@ -1,2 +1,2 @@
|
||||||
include ':app', ':libaums', ':dmg2img'
|
include ':app', ':libaums', ':dmg2img', ':parted'
|
||||||
project(':libaums').projectDir = new File('libaums/libaums')
|
project(':libaums').projectDir = new File('libaums/libaums')
|
Loading…
Reference in a new issue