Project

General

Profile

packaging Replicant SDK for Debian

Added by Hans-Christoph Steiner almost 10 years ago

There is now a fledgling team for packaging Android tools for Debian: https://alioth.debian.org/projects/android-tools/ I've been trying to package platform/system/core to start with since so much depends on stuff there. I have been wrestling to figure out which branch to build. I started with the tools_r21 branch since it seems to be about the SDK. But then I found out that it does not include libutils, which lots of things seem to depend on. So I tried the Replicant SDK 4.2, which seems to include the utilities that I want to get working first (zipalign and aapt). But the Replicant SDK sources also don't seem to include libutils.

So maybe you can help me figure these crazy details out, so we can start the process of getting the Replicant SDK packaged and in Debian.


Replies (3)

RE: packaging Replicant SDK for Debian - Added by Paul Kocialkowski almost 10 years ago

How great that Debian developers are considering using the Replicant source code instead of AOSP!

As far as I know, fastboot and adb are already in Debian and are based-off AOSP (which is equivalent to Replicant in that case). So if I understood correctly, you're trying to pack other software in Debian, such as zipalign and aapt. Let's take a closer look at zipalign: build/tools/zipalign. It does depend on libutils and libcutils, which are located at frameworks/native/libs/ and system/core/libcutils/. Here is the build log for zipalign, I hope it helps:

make -j12 zipalign
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=
TARGET_PRODUCT=replicant_crespo
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13-1-amd64-x86_64-with-debian-jessie-sid
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/home/paulk/projets/replicant/replicant-4.2/out
============================================
*** Overlay change detected, clean shared intermediate files...
*** rm -rf /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/Settings_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/framework-res_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/Torch_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/ImfTest_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/Phone_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/LatinIME_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/Launcher2_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/SettingsProvider_intermediates /home/paulk/projets/replicant/replicant-4.2/out/target/common/obj/APPS/SystemUI_intermediates
build/core/Makefile:44: attention : écrasement des commandes pour la cible « /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/system/etc/mkshrc »
build/core/base_rules.mk:502: attention : anciennes commandes ignorées pour la cible « /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/system/etc/mkshrc »
PRODUCT_COPY_FILES device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml ignored.
No private recovery resources for TARGET_DEVICE crespo
Export includes file: frameworks/native/libs/utils/Android.mk -- /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/export_includes
Export includes file: system/core/libcutils/Android.mk -- /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/export_includes
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libexpat/expat.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libexpat/expat_external.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libpng/png.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libpng/pngconf.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libpng/pngusr.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/selinux/selinux.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/selinux/label.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/selinux/context.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/selinux/avc.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/selinux/android.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libsonivox/eas.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libsonivox/eas_types.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libsonivox/eas_reverb.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libsonivox/jet.h
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libsonivox/ARM_synth_constants_gnu.inc
Header: /home/paulk/projets/replicant/replicant-4.2/out/target/product/crespo/obj/include/libwpa_client/wpa_ctrl.h
Export includes file: external/zlib/Android.mk -- /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libz_intermediates/export_includes
Import includes file: /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/import_includes
Export includes file: build/tools/zipalign/Android.mk -- /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/EXECUTABLES/zipalign_intermediates/export_includes
Notice file: frameworks/native/libs/utils/NOTICE -- /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/NOTICE_FILES/src//lib/libutils.a.txt
Notice file: system/core/libcutils/NOTICE -- /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/NOTICE_FILES/src//lib/libcutils.a.txt
Import includes file: /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/EXECUTABLES/zipalign_intermediates/import_includes
Import includes file: /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/import_includes
host C++: zipalign <= build/tools/zipalign/ZipAlign.cpp
host C++: zipalign <= build/tools/zipalign/ZipEntry.cpp
host C++: zipalign <= build/tools/zipalign/ZipFile.cpp
host C++: libutils <= frameworks/native/libs/utils/BasicHashtable.cpp
host C++: libutils <= frameworks/native/libs/utils/BlobCache.cpp
host C++: libutils <= frameworks/native/libs/utils/BufferedTextOutput.cpp
host C++: libutils <= frameworks/native/libs/utils/CallStack.cpp
host C++: libutils <= frameworks/native/libs/utils/Debug.cpp
host C++: libutils <= frameworks/native/libs/utils/FileMap.cpp
host C++: libutils <= frameworks/native/libs/utils/LinearTransform.cpp
host C++: libutils <= frameworks/native/libs/utils/Flattenable.cpp
host C++: libutils <= frameworks/native/libs/utils/Log.cpp
host C++: libutils <= frameworks/native/libs/utils/PropertyMap.cpp
host C++: libutils <= frameworks/native/libs/utils/RefBase.cpp
host C++: libutils <= frameworks/native/libs/utils/SharedBuffer.cpp
host C++: libutils <= frameworks/native/libs/utils/Static.cpp
host C++: libutils <= frameworks/native/libs/utils/StopWatch.cpp
host C++: libutils <= frameworks/native/libs/utils/String8.cpp
host C++: libutils <= frameworks/native/libs/utils/String16.cpp
host C++: libutils <= frameworks/native/libs/utils/StringArray.cpp
host C++: libutils <= frameworks/native/libs/utils/SystemClock.cpp
host C++: libutils <= frameworks/native/libs/utils/TextOutput.cpp
host C++: libutils <= frameworks/native/libs/utils/Threads.cpp
host C++: libutils <= frameworks/native/libs/utils/Timers.cpp
host C++: libutils <= frameworks/native/libs/utils/Tokenizer.cpp
host C++: libutils <= frameworks/native/libs/utils/Unicode.cpp
host C++: libutils <= frameworks/native/libs/utils/VectorImpl.cpp
host C++: libutils <= frameworks/native/libs/utils/WorkQueue.cpp
host C++: libutils <= frameworks/native/libs/utils/ZipFileCRO.cpp
host C++: libutils <= frameworks/native/libs/utils/ZipFileRO.cpp
host C++: libutils <= frameworks/native/libs/utils/ZipUtils.cpp
host C++: libutils <= frameworks/native/libs/utils/misc.cpp
host C++: libutils <= frameworks/native/libs/utils/Looper.cpp
host C: libcutils <= system/core/libcutils/atomic.c
host C: libcutils <= system/core/libcutils/array.c
host C: libcutils <= system/core/libcutils/hashmap.c
host C: libcutils <= system/core/libcutils/native_handle.c
host C: libcutils <= system/core/libcutils/buffer.c
host C: libcutils <= system/core/libcutils/socket_inaddr_any_server.c
host C: libcutils <= system/core/libcutils/socket_local_client.c
host C: libcutils <= system/core/libcutils/socket_local_server.c
host C: libcutils <= system/core/libcutils/socket_loopback_client.c
host C: libcutils <= system/core/libcutils/socket_loopback_server.c
host C: libcutils <= system/core/libcutils/socket_network_client.c
host C: libcutils <= system/core/libcutils/sockets.c
host C: libcutils <= system/core/libcutils/config_utils.c
host C: libcutils <= system/core/libcutils/cpu_info.c
host C: libcutils <= system/core/libcutils/load_file.c
host C: libcutils <= system/core/libcutils/list.c
host C: libcutils <= system/core/libcutils/open_memstream.c
host C: libcutils <= system/core/libcutils/strdup16to8.c
host C: libcutils <= system/core/libcutils/strdup8to16.c
host C: libcutils <= system/core/libcutils/record_stream.c
host C: libcutils <= system/core/libcutils/process_name.c
host C: libcutils <= system/core/libcutils/properties.c
host C: libcutils <= system/core/libcutils/qsort_r_compat.c
host C: libcutils <= system/core/libcutils/threads.c
host C: libcutils <= system/core/libcutils/sched_policy.c
host C: libcutils <= system/core/libcutils/iosched_policy.c
host C: libcutils <= system/core/libcutils/str_parms.c
host C: libcutils <= system/core/libcutils/abort_socket.c
host C: libcutils <= system/core/libcutils/fs.c
host C: libcutils <= system/core/libcutils/selector.c
host C: libcutils <= system/core/libcutils/tztime.c
host C: libcutils <= system/core/libcutils/multiuser.c
host C: libcutils <= system/core/libcutils/zygote.c
host C: libcutils <= system/core/libcutils/ashmem-host.c
host C: libcutils <= system/core/libcutils/tzstrftime.c
host C: libcutils <= system/core/libcutils/dlmalloc_stubs.c
system/core/libcutils/fs.c: In function 'fs_write_atomic_int':
system/core/libcutils/fs.c:109:5: warning: implicit declaration of function 'mkstemp' [-Wimplicit-function-declaration]
host StaticLib: libutils (/home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/libutils.a)
system/core/libcutils/tztime.c: In function 'differ_by_repeat':
system/core/libcutils/tztime.c:303:2: warning: comparison is always false due to limited range of data type [-Wtype-limits]
system/core/libcutils/tztime.c: In function 'localsub':
system/core/libcutils/tztime.c:1267:24: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
host StaticLib: libcutils (/home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a)
host Executable: zipalign (/home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/obj/EXECUTABLES/zipalign_intermediates/zipalign)
Install: /home/paulk/projets/replicant/replicant-4.2/out/host/linux-x86/bin/zipalign

RE: packaging Replicant SDK for Debian - Added by Hans-Christoph Steiner almost 10 years ago

This is very helpful, thanks! A couple more questions:

  • Does replicant-sdk_linux-x86.zip include the source?
  • If not, where do I get the source? Ideally there would be a source-only tarball to work with since that's how Debian packaging generally works.
  • Otherwise, I can manage the source directly from Replicant's git repo, but that seems to make the build process more complicated since it would have to be built as separate chunks aligned with the git repos.
  • where in the source do I run make -j12 zipalign?
  • can you point me to which chunks of the Replicant SDK is different than AOSP, i.e. is Replicant's frameworks_native the same as AOSP's platform/frameworks/native.git?

To be clear, it is just me that is so far working on packaging the Replicant SDK, as far as I know, the other contributors to the android-tools team have not worked on Replicant. But I am to change that. I think it makes perfect sense to start by packaging the Replicant SDK over AOSP because Debian and Replicant's goals are completely aligned.

RE: packaging Replicant SDK for Debian - Added by Paul Kocialkowski almost 10 years ago

  • The source isn't included in the SDK packages (which matches more or less what is in the Google SDK releases), since it's about 14GB!
  • We build the SDK from the whole Replicant source, which is quite big and includes all the other stuff for devices
  • You can get all the info on building Replicant on our wiki: BuildDependenciesInstallation and ReplicantSources. Instructions to build the SDK are available at SDKBuild

where in the source do I run make -j12 zipalign?

  • Basically, after running source build/envsetup.sh and the lunch command, you can use make directly to build modules, such as zipalign.

can you point me to which chunks of the Replicant SDK is different than AOSP, i.e. is Replicant's frameworks_native the same as AOSP's platform/frameworks/native.git?

Well, as far as the SDK is concerned, we just took the CyanogenMod/AOSP source and perhaps fixed compilation issues, but not anything deep. Everything from AOSP related to the SDK should be free software already, so you might as well use AOSP.

To be clear, it is just me that is so far working on packaging the Replicant SDK, as far as I know, the other contributors to the android-tools team have not worked on Replicant. But I am to change that. I think it makes perfect sense to start by packaging the Replicant SDK over AOSP because Debian and Replicant's goals are completely aligned.

I understand, this looks like a very good idea! I'm really glad people from Debian are considering Replicant instead of AOSP. However as I said, the AOSP code regarding the SDK is already free software, so you might as well use it directly. That way you can get the newer versions of the package, since we rarely update Replicant to the latest Android versions (we're currently based on 4.2.2 while the current AOSP is 4.4.2 and we're not going to port to the new version anytime soon).

What I suggest you do however, is to avoid using the whole source tree for building Debian packages but instead use the separate repos from AOSP and autotoolize-them (I suppose that's what you did already with adb, fastboot and friends).

    (1-3/3)