uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,15 @@
diff -Naur blah/src/gitinfo.h blah2/src/gitinfo.h
--- blah/src/gitinfo.h 1969-12-31 16:00:00.000000000 -0800
+++ blah2/src/gitinfo.h 2017-09-15 01:44:43.953562714 -0700
@@ -0,0 +1,11 @@
+// dd3c3b57023f64cda84f09ed13e4c03a4ad2b920
+//
+// This file was automatically generated by the
+// updaterevision tool. Do not edit by hand.
+
+#define GIT_DESCRIPTION "ZA_3.0-0-dd3c3b57023f"
+#define GIT_HASH "dd3c3b57023f64cda84f09ed13e4c03a4ad2b920"
+#define GIT_TIME "2017-09-01 06:40:50 -0500"
+#define HG_REVISION_NUMBER 1504266050
+#define HG_REVISION_HASH_STRING "dd3c3b57023f"
+#define HG_TIME "170901-1140"

View file

@ -0,0 +1,82 @@
{ stdenv, lib, fetchhg, cmake, pkg-config, makeWrapper, callPackage
, soundfont-fluid, SDL, libGL, glew, bzip2, zlib, libjpeg, fluidsynth, openssl, gtk2, python3, libgme
, serverOnly ? false
}:
let
suffix = lib.optionalString serverOnly "-server";
fmod = callPackage ./fmod.nix { };
sqlite = callPackage ./sqlite.nix { };
clientLibPath = lib.makeLibraryPath [ fluidsynth ];
in stdenv.mkDerivation rec {
pname = "zandronum${suffix}";
version = "3.0.1";
src = fetchhg {
url = "https://hg.osdn.net/view/zandronum/zandronum-stable";
rev = "ZA_${version}";
sha256 = "16v5b6wfrmabs3ky6isbfhlrqdjrr1pvfxlxwk0im02kcpxxw9qw";
};
# zandronum tries to download sqlite now when running cmake, don't let it
# it also needs the current mercurial revision info embedded in gitinfo.h
# otherwise, the client will fail to connect to servers because the
# protocol version doesn't match.
patches = [ ./zan_configure_impurity.patch ./add_gitinfo.patch ./dont_update_gitinfo.patch ];
# I have no idea why would SDL and libjpeg be needed for the server part!
# But they are.
buildInputs = [ openssl bzip2 zlib SDL libjpeg sqlite libgme ]
++ lib.optionals (!serverOnly) [ libGL glew fmod fluidsynth gtk2 ];
nativeBuildInputs = [ cmake pkg-config makeWrapper python3 ];
preConfigure = ''
ln -s ${sqlite}/* sqlite/
sed -ie 's| restrict| _restrict|g' dumb/include/dumb.h \
dumb/src/it/*.c
'' + lib.optionalString (!serverOnly) ''
sed -i \
-e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \
-e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \
src/sound/music_fluidsynth_mididevice.cpp
'';
cmakeFlags =
[ "-DFORCE_INTERNAL_GME=OFF" ]
++ (if serverOnly
then [ "-DSERVERONLY=ON" ]
else [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]);
hardeningDisable = [ "format" ];
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib/zandronum
cp zandronum${suffix} \
*.pk3 \
${lib.optionalString (!serverOnly) "liboutput_sdl.so"} \
$out/lib/zandronum
makeWrapper $out/lib/zandronum/zandronum${suffix} $out/bin/zandronum${suffix}
'';
postFixup = lib.optionalString (!serverOnly) ''
patchelf --set-rpath $(patchelf --print-rpath $out/lib/zandronum/zandronum):$out/lib/zandronum:${clientLibPath} \
$out/lib/zandronum/zandronum
'';
passthru = {
inherit fmod sqlite;
};
meta = with lib; {
homepage = "https://zandronum.com/";
description = "Multiplayer oriented port, based off Skulltag, for Doom and Doom II by id Software";
maintainers = with maintainers; [ lassulus MP2E ];
license = licenses.unfreeRedistributable;
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,19 @@
diff -r dd3c3b57023f src/CMakeLists.txt
--- a/src/CMakeLists.txt Fri Sep 01 06:40:50 2017 -0500
+++ b/src/CMakeLists.txt Fri Sep 15 01:46:34 2017 -0700
@@ -636,15 +636,6 @@
add_definitions( -DBACKPATCH )
endif( BACKPATCH )
-# Update gitinfo.h
-
-get_target_property( UPDATEREVISION_EXE updaterevision LOCATION )
-
-add_custom_target( revision_check ALL
- COMMAND ${UPDATEREVISION_EXE} src/gitinfo.h
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- DEPENDS updaterevision )
-
# Libraries ZDoom needs
message( STATUS "Fluid synth libs: ${FLUIDSYNTH_LIBRARIES}" )

View file

@ -0,0 +1,45 @@
{ stdenv, lib, fetchurl, alsa-lib, libpulseaudio, undmg }:
let
bits = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "64";
libPath = lib.makeLibraryPath [ stdenv.cc.cc alsa-lib libpulseaudio ];
in
stdenv.mkDerivation rec {
pname = "fmod";
version = "4.44.64";
shortVersion = builtins.replaceStrings [ "." ] [ "" ] version;
src = fetchurl (if stdenv.isLinux then {
url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}linux.tar.gz";
sha256 = "047hk92xapwwqj281f4zwl0ih821rrliya70gfj82sdfjh9lz8i1";
} else {
url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}mac-installer.dmg";
sha256 = "1m1y4cpcwpkl8x31d3s68xzp107f343ma09w2437i2adn5y7m8ii";
});
nativeBuildInputs = [ undmg ];
dontStrip = true;
dontPatchELF = true;
dontBuild = true;
installPhase = lib.optionalString stdenv.isLinux ''
install -Dm755 api/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex-${version}.so
ln -s libfmodex-${version}.so $out/lib/libfmodex.so
patchelf --set-rpath ${libPath} $out/lib/libfmodex.so
'' + lib.optionalString stdenv.isDarwin ''
install -D api/lib/libfmodex.dylib $out/lib/libfmodex.dylib
install -D api/lib/libfmodexL.dylib $out/lib/libfmodexL.dylib
'' + ''
cp -r api/inc $out/include
'';
meta = with lib; {
description = "Programming library and toolkit for the creation and playback of interactive audio";
homepage = "http://www.fmod.org/";
license = licenses.unfreeRedistributable;
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
maintainers = [ maintainers.lassulus ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation {
pname = "sqlite-zandronum";
version = "3.0";
src = fetchurl {
url = "https://www.sqlite.org/2017/sqlite-autoconf-3180000.tar.gz";
sha256 = "0p5cx7nbjxk7glcm277ypi5w4gv144qazw79ql47svlpccj62mrp";
};
buildPhase = ''
mkdir -p $out
cp sqlite3.c $out/
cp sqlite3.h $out/
cp sqlite3ext.h $out/
'';
meta = {
homepage = "http://www.sqlite.org/";
description = "A single C code file, named sqlite3.c, that contains all C code for the core SQLite library and the FTS3 and RTREE extensions";
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.lassulus ];
};
}

View file

@ -0,0 +1,65 @@
diff -r 6d5130e4ae52 sqlite/CMakeLists.txt
--- a/sqlite/CMakeLists.txt Sun Sep 10 18:53:00 2017 +0200
+++ b/sqlite/CMakeLists.txt Fri Sep 15 00:12:11 2017 -0700
@@ -1,62 +1,5 @@
cmake_minimum_required( VERSION 2.4 )
-# [BB/EP] Download SQLite archive and extract the sources if necessary.
-set( ZAN_SQLITE_VERSION 3180000 ) # SQL version 3.18.0
-set( ZAN_SQLITE_YEAR 2017 )
-set( ZAN_SQLITE_SHA1 "74559194e1dd9b9d577cac001c0e9d370856671b" )
-set( ZAN_SQLITE_DOWNLOAD_NAME "sqlite-autoconf-${ZAN_SQLITE_VERSION}" )
-set( ZAN_SQLITE_TEMP_ARCHIVE "${CMAKE_CURRENT_SOURCE_DIR}/${ZAN_SQLITE_DOWNLOAD_NAME}.tar.gz" )
-set( ZAN_SQLITE_HASHED_ARCHIVE "${CMAKE_CURRENT_SOURCE_DIR}/sqlite-${ZAN_SQLITE_SHA1}.tar.gz" )
-
-if( IS_DIRECTORY ${ZAN_SQLITE_HASHED_ARCHIVE} OR IS_SYMLINK ${ZAN_SQLITE_HASHED_ARCHIVE} )
- message( FATAL_ERROR "SQLite: ${ZAN_SQLITE_HASHED_ARCHIVE} must be a valid file.\n"
- "SQLite: Please remove it and try again." )
-elseif( NOT EXISTS ${ZAN_SQLITE_HASHED_ARCHIVE} )
-
- if( IS_DIRECTORY ${ZAN_SQLITE_TEMP_ARCHIVE} OR IS_SYMLINK ${ZAN_SQLITE_TEMP_ARCHIVE} )
- message( FATAL_ERROR "SQLite: ${ZAN_SQLITE_TEMP_ARCHIVE} must be a valid file.\n"
- "SQLite: Please remove it and try again." )
- endif()
- message( STATUS "SQLite: downloading the archive..." )
-
- file( DOWNLOAD https://www.sqlite.org/${ZAN_SQLITE_YEAR}/${ZAN_SQLITE_DOWNLOAD_NAME}.tar.gz ${ZAN_SQLITE_TEMP_ARCHIVE}
- SHOW_PROGRESS
- STATUS ZAN_SQLITE_DOWNLOAD_STATUS )
-
- # Report any problem if present and abort immediately.
- list( GET ZAN_SQLITE_DOWNLOAD_STATUS 0 ZAN_SQLITE_DOWNLOAD_ERROR_CODE )
- if( ZAN_SQLITE_DOWNLOAD_ERROR_CODE )
- list( GET ZAN_SQLITE_DOWNLOAD_STATUS 1 ZAN_SQLITE_DOWNLOAD_ERROR_MESSAGE )
- message( FATAL_ERROR "SQLite: download failed. Reason: ${ZAN_SQLITE_DOWNLOAD_ERROR_MESSAGE}" )
- endif()
-
- # Check the hash. Abort immediately if it's not valid (something is wrong with the download)
- file( SHA1 ${ZAN_SQLITE_TEMP_ARCHIVE} ZAN_SQLITE_CURRENT_SHA1 )
- if( NOT ZAN_SQLITE_CURRENT_SHA1 STREQUAL ZAN_SQLITE_SHA1 )
- message( FATAL_ERROR "SQLite: download failed. The downloaded file has a different hash:\n"
- "SQLite: valid: ${ZAN_SQLITE_SHA1}\n"
- "SQLite: downloaded: ${ZAN_SQLITE_CURRENT_SHA1}" )
- endif()
-
- message( STATUS "SQLite: saving the source files into the 'sqlite' directory." )
-
- # Rename the archive.
- execute_process( COMMAND ${CMAKE_COMMAND} -E rename ${ZAN_SQLITE_TEMP_ARCHIVE} ${ZAN_SQLITE_HASHED_ARCHIVE} )
-
- # Extract the archive.
- execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${ZAN_SQLITE_HASHED_ARCHIVE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
-
- # Copy the required files.
- execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${ZAN_SQLITE_DOWNLOAD_NAME}/sqlite3.c ${CMAKE_CURRENT_SOURCE_DIR} )
- execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${ZAN_SQLITE_DOWNLOAD_NAME}/sqlite3.h ${CMAKE_CURRENT_SOURCE_DIR} )
- execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${ZAN_SQLITE_DOWNLOAD_NAME}/sqlite3ext.h ${CMAKE_CURRENT_SOURCE_DIR} )
-
- # Remove the extracted folder.
- execute_process( COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/${ZAN_SQLITE_DOWNLOAD_NAME} )
-
- message( STATUS "SQLite: done." )
-endif()
-
add_library( sqlite3 sqlite3.c )
target_link_libraries( sqlite3 ${CMAKE_DL_LIBS} )