diff options
Diffstat (limited to 'pkgs/development/libraries/aemu')
-rw-r--r-- | pkgs/development/libraries/aemu/LFS64.patch | 98 | ||||
-rw-r--r-- | pkgs/development/libraries/aemu/default.nix | 40 |
2 files changed, 0 insertions, 138 deletions
diff --git a/pkgs/development/libraries/aemu/LFS64.patch b/pkgs/development/libraries/aemu/LFS64.patch deleted file mode 100644 index e1d06d8073ef..000000000000 --- a/pkgs/development/libraries/aemu/LFS64.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 455341880f52b4df3b30490db1c17eb65110c00c Mon Sep 17 00:00:00 2001 -From: Alyssa Ross <hi@alyssa.is> -Date: Wed, 29 May 2024 10:29:02 +0200 -Subject: [PATCH] Stop using transitional LFS64 APIs - -The *64 APIs were intended for transitional use, and have been removed -in musl 1.2.4. Nowadays, the best practice is to set -_FILE_OFFSET_BITS=64 across the board, making all the unsuffixed APIs -will be 64-bit. This fixes building with recent versions of musl, and -avoids the need to remember to use the *64 variants every time to -properly handle large files on 32-bit platforms. - -Test: build with musl 1.2.4. -Change-Id: I7fa7a3ae4aa19a765740f5b2af916fd6f0ed0b32 ---- - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4de86a4..10c402a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -69,7 +69,7 @@ - add_subdirectory(build-config/${AEMU_COMMON_BUILD_CONFIG}) - endif() - --set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extern-c-compat -Wno-return-type-c-linkage") -+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-extern-c-compat -Wno-return-type-c-linkage -D_FILE_OFFSET_BITS=64") - - add_subdirectory(base) - add_subdirectory(snapshot) -diff --git a/snapshot/TextureLoader.cpp b/snapshot/TextureLoader.cpp -index 31e02e8..5c21134 100644 ---- a/snapshot/TextureLoader.cpp -+++ b/snapshot/TextureLoader.cpp -@@ -46,7 +46,7 @@ - void TextureLoader::loadTexture(uint32_t texId, const loader_t& loader) { - android::base::AutoLock scopedLock(mLock); - assert(mIndex.count(texId)); -- HANDLE_EINTR(fseeko64(mStream.get(), mIndex[texId], SEEK_SET)); -+ HANDLE_EINTR(fseeko(mStream.get(), mIndex[texId], SEEK_SET)); - switch (mVersion) { - case 1: - loader(&mStream); -@@ -71,7 +71,7 @@ - mDiskSize = size; - } - auto indexPos = mStream.getBe64(); -- HANDLE_EINTR(fseeko64(mStream.get(), static_cast<int64_t>(indexPos), SEEK_SET)); -+ HANDLE_EINTR(fseeko(mStream.get(), static_cast<int64_t>(indexPos), SEEK_SET)); - mVersion = mStream.getBe32(); - if (mVersion < 1 || mVersion > 2) { - return false; -diff --git a/snapshot/TextureSaver.cpp b/snapshot/TextureSaver.cpp -index 537626b..c8854e9 100644 ---- a/snapshot/TextureSaver.cpp -+++ b/snapshot/TextureSaver.cpp -@@ -50,7 +50,7 @@ - [texId](FileIndex::Texture& tex) { - return tex.texId == texId; - })); -- mIndex.textures.push_back({texId, ftello64(mStream.get())}); -+ mIndex.textures.push_back({texId, ftello(mStream.get())}); - - CompressingStream stream(mStream); - saver(&stream, &mBuffer); -@@ -60,7 +60,7 @@ - if (mFinished) { - return; - } -- mIndex.startPosInFile = ftello64(mStream.get()); -+ mIndex.startPosInFile = ftello(mStream.get()); - writeIndex(); - mEndTime = base::getHighResTimeUs(); - #if SNAPSHOT_PROFILE > 1 -@@ -74,7 +74,7 @@ - - void TextureSaver::writeIndex() { - #if SNAPSHOT_PROFILE > 1 -- auto start = ftello64(mStream.get()); -+ auto start = ftello(mStream.get()); - #endif - - mStream.putBe32(static_cast<uint32_t>(mIndex.version)); -@@ -83,13 +83,13 @@ - mStream.putBe32(b.texId); - mStream.putBe64(static_cast<uint64_t>(b.filePos)); - } -- auto end = ftello64(mStream.get()); -+ auto end = ftello(mStream.get()); - mDiskSize = uint64_t(end); - #if SNAPSHOT_PROFILE > 1 - printf("texture: index size: %d\n", int(end - start)); - #endif - -- fseeko64(mStream.get(), 0, SEEK_SET); -+ fseeko(mStream.get(), 0, SEEK_SET); - mStream.putBe64(static_cast<uint64_t>(mIndex.startPosInFile)); - } - diff --git a/pkgs/development/libraries/aemu/default.nix b/pkgs/development/libraries/aemu/default.nix deleted file mode 100644 index 0a2f6fa8b8b2..000000000000 --- a/pkgs/development/libraries/aemu/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ lib, stdenv, fetchFromGitiles, cmake, darwin }: - -stdenv.mkDerivation { - pname = "aemu"; - version = "0.1.2"; - - src = fetchFromGitiles { - url = "https://android.googlesource.com/platform/hardware/google/aemu"; - rev = "07ccc3ded3357e67e39104f18f35feaf8b3b6a0e"; - hash = "sha256-H3IU9aTFSzUAqYgrtHd4F18hbhZsbOJGC4K5JwMQOOw="; - }; - - patches = [ - # stop using transitional LFS64 APIs, which are removed in musl 1.2.4 - # https://android-review.googlesource.com/c/platform/hardware/google/aemu/+/3105640/1 - ./LFS64.patch - ]; - - nativeBuildInputs = [ cmake ]; - buildInputs = lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.Cocoa - ]; - - cmakeFlags = [ - "-DAEMU_COMMON_GEN_PKGCONFIG=ON" - "-DAEMU_COMMON_BUILD_CONFIG=gfxstream" - # "-DENABLE_VKCEREAL_TESTS=OFF" - ]; - - meta = with lib; { - homepage = "https://android.googlesource.com/platform/hardware/google/aemu"; - description = "Android emulation utilities library"; - maintainers = with maintainers; [ qyliss ]; - # The BSD license comes from host-common/VpxFrameParser.cpp, which - # incorporates some code from libvpx, which uses the 3-clause BSD license. - license = with licenses; [ asl20 mit bsd3 ]; - # See base/include/aemu/base/synchronization/Lock.h - platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - }; -} |