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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
98
pkgs/development/compilers/ponyc/default.nix
Normal file
98
pkgs/development/compilers/ponyc/default.nix
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, pcre2, coreutils, which, openssl, libxml2, cmake, z3, substituteAll, python3,
|
||||
cc ? stdenv.cc, lto ? !stdenv.isDarwin }:
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
pname = "ponyc";
|
||||
version = "0.50.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ponylang";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-FnzlFTiJrqoUfnys+q9is6OH9yit5ExDiRszQ679QbY=";
|
||||
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
ponygbenchmark = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "benchmark";
|
||||
rev = "v1.5.4";
|
||||
sha256 = "1dbjdjzkpbsq3jl9ksyg8mw759vkac8qzq1557m73ldnavbhz48x";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake makeWrapper which python3 ];
|
||||
buildInputs = [ libxml2 z3 ];
|
||||
|
||||
# Sandbox disallows network access, so disabling problematic networking tests
|
||||
patches = [
|
||||
./disable-tests.patch
|
||||
(substituteAll {
|
||||
src = ./make-safe-for-sandbox.patch;
|
||||
googletest = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "googletest";
|
||||
rev = "release-1.10.0";
|
||||
sha256 = "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz";
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
postUnpack = ''
|
||||
mkdir -p source/build/build_libs/gbenchmark-prefix/src
|
||||
cp -r "$ponygbenchmark"/ source/build/build_libs/gbenchmark-prefix/src/benchmark
|
||||
chmod -R u+w source/build/build_libs/gbenchmark-prefix/src/benchmark
|
||||
'';
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
postPatch = ''
|
||||
# Patching Vendor LLVM
|
||||
patchShebangs --host build/build_libs/gbenchmark-prefix/src/benchmark/tools/*.py
|
||||
patch -d lib/llvm/src/ -p1 < lib/llvm/patches/2020-07-28-01-c-exports.diff
|
||||
substituteInPlace packages/process/_test.pony \
|
||||
--replace '"/bin/' '"${coreutils}/bin/' \
|
||||
--replace '=/bin' "${coreutils}/bin"
|
||||
substituteInPlace src/libponyc/pkg/package.c \
|
||||
--replace "/usr/local/lib" "" \
|
||||
--replace "/opt/local/lib" ""
|
||||
'';
|
||||
|
||||
|
||||
preBuild = ''
|
||||
make libs build_flags=-j$NIX_BUILD_CORES
|
||||
make configure build_flags=-j$NIX_BUILD_CORES
|
||||
'';
|
||||
|
||||
makeFlags = [
|
||||
"PONYC_VERSION=${version}"
|
||||
"prefix=${placeholder "out"}"
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [ "bits=64" ]
|
||||
++ lib.optionals (stdenv.isDarwin && (!lto)) [ "lto=no" ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
NIX_CFLAGS_COMPILE = [ "-Wno-error=redundant-move" "-Wno-error=implicit-fallthrough" ];
|
||||
|
||||
installPhase = "make config=release prefix=$out "
|
||||
+ lib.optionalString stdenv.isDarwin "bits=64 "
|
||||
+ lib.optionalString (stdenv.isDarwin && (!lto)) "lto=no "
|
||||
+ '' install
|
||||
wrapProgram $out/bin/ponyc \
|
||||
--prefix PATH ":" "${stdenv.cc}/bin" \
|
||||
--set-default CC "$CC" \
|
||||
--prefix PONYPATH : "${lib.makeLibraryPath [ pcre2 openssl (placeholder "out") ]}"
|
||||
'';
|
||||
|
||||
# Stripping breaks linking for ponyc
|
||||
dontStrip = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Pony is an Object-oriented, actor-model, capabilities-secure, high performance programming language";
|
||||
homepage = "https://www.ponylang.org";
|
||||
license = licenses.bsd2;
|
||||
maintainers = with maintainers; [ kamilchm patternspandemic redvers ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
})
|
||||
16
pkgs/development/compilers/ponyc/disable-tests.patch
Normal file
16
pkgs/development/compilers/ponyc/disable-tests.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
diff --git a/packages/net/_test.pony b/packages/net/_test.pony
|
||||
index 9044dfb1..f0ea10f7 100644
|
||||
--- a/packages/net/_test.pony
|
||||
+++ b/packages/net/_test.pony
|
||||
@@ -26,11 +26,6 @@ actor \nodoc\ Main is TestList
|
||||
test(_TestTCPThrottle)
|
||||
end
|
||||
|
||||
- // Tests below exclude osx and are listed alphabetically
|
||||
- ifdef not osx then
|
||||
- test(_TestBroadcast)
|
||||
- end
|
||||
-
|
||||
class \nodoc\ _TestPing is UDPNotify
|
||||
let _h: TestHelper
|
||||
let _ip: NetAddress
|
||||
105
pkgs/development/compilers/ponyc/make-safe-for-sandbox.patch
Normal file
105
pkgs/development/compilers/ponyc/make-safe-for-sandbox.patch
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
|
||||
index dab2aaef..26b587b1 100644
|
||||
--- a/lib/CMakeLists.txt
|
||||
+++ b/lib/CMakeLists.txt
|
||||
@@ -36,7 +36,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(gbenchmark
|
||||
- URL ${PONYC_GBENCHMARK_URL}
|
||||
+ SOURCE_DIR gbenchmark-prefix/src/benchmark
|
||||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${PONYC_LIBS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBENCHMARK_ENABLE_GTEST_TESTS=OFF -DCMAKE_CXX_FLAGS=${PONY_PIC_FLAG} --no-warn-unused-cli
|
||||
)
|
||||
|
||||
@@ -46,7 +46,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(googletest
|
||||
- URL ${PONYC_GOOGLETEST_URL}
|
||||
+ URL @googletest@
|
||||
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${PONYC_LIBS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_CXX_FLAGS=${PONY_PIC_FLAG} -Dgtest_force_shared_crt=ON --no-warn-unused-cli
|
||||
)
|
||||
|
||||
@@ -59,82 +59,6 @@ install(TARGETS blake2
|
||||
COMPONENT library
|
||||
)
|
||||
|
||||
-find_package(Git)
|
||||
-
|
||||
-set(LLVM_DESIRED_HASH "75e33f71c2dae584b13a7d1186ae0a038ba98838")
|
||||
-set(PATCHES_DESIRED_HASH "a16f299fbfced16a2bbc628746db341f2a5af9ae8cc9c9ef4b1e9ca26de3c292")
|
||||
-
|
||||
-if(GIT_FOUND)
|
||||
- if(EXISTS "${PROJECT_SOURCE_DIR}/../.git")
|
||||
- # Update submodules as needed
|
||||
- option(GIT_SUBMODULE "Check submodules during build" ON)
|
||||
- if(GIT_SUBMODULE)
|
||||
- message(STATUS "Updating submodules...")
|
||||
- execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive --depth 1
|
||||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
- RESULT_VARIABLE git_submod_result)
|
||||
- #message("git_submod_result ${git_submod_result}")
|
||||
- if(NOT git_submod_result EQUAL "0")
|
||||
- message(FATAL_ERROR "git submodule update --init --recursive --depth 1 failed with ${git_submod_result}, please checkout submodules")
|
||||
- endif()
|
||||
-
|
||||
- # we check to make sure the submodule hash matches
|
||||
- # the reason the submodule hash is in this file is to be able to use this file as a key for caching the libs in CI
|
||||
- execute_process(COMMAND ${GIT_EXECUTABLE} submodule status
|
||||
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
- OUTPUT_VARIABLE git_submod_output)
|
||||
- #message("git_submod_output ${git_submod_output}")
|
||||
- string(FIND "${git_submod_output}" "${LLVM_DESIRED_HASH}" LLVM_SUBMOD_POS)
|
||||
- if(LLVM_SUBMOD_POS EQUAL "-1")
|
||||
- message(FATAL_ERROR "Expecting the lib/llvm/src submodule to be at hash '${LLVM_DESIRED_HASH}'; found '${git_submod_output}'; update the LLVM_DESIRED_HASH variable in lib/CMakeLists.txt if you've updated the submodule.")
|
||||
- endif()
|
||||
- endif()
|
||||
- endif()
|
||||
-
|
||||
- # Apply patches
|
||||
- message("Applying patches...")
|
||||
- file(GLOB PONY_LLVM_PATCHES "${PROJECT_SOURCE_DIR}/llvm/patches/*.diff")
|
||||
-
|
||||
- # check to see if the patch hashes match
|
||||
- message("Checking patches ${PONY_LLVM_PATCHES}")
|
||||
- set(PATCHES_ACTUAL_HASH "needed_if_no_patches")
|
||||
- foreach (PATCH ${PONY_LLVM_PATCHES})
|
||||
- file(STRINGS ${PATCH} patch_file NEWLINE_CONSUME)
|
||||
- string(REPLACE "\n" " " patch_file ${patch_file})
|
||||
- string(SHA256 patch_file_hash ${patch_file})
|
||||
- # message("${PATCH}: '${patch_file_hash}'")
|
||||
- string(CONCAT PATCHES_ACTUAL_HASH ${PATCHES_ACTUAL_HASH} ${patch_file_hash})
|
||||
- # message("concat is '${PATCHES_ACTUAL_HASH}'")
|
||||
- endforeach()
|
||||
- string(SHA256 PATCHES_ACTUAL_HASH ${PATCHES_ACTUAL_HASH})
|
||||
- # message("Desired hash ${PATCHES_DESIRED_HASH}")
|
||||
- # message("Actual hash ${PATCHES_ACTUAL_HASH}")
|
||||
- if(NOT PATCHES_ACTUAL_HASH MATCHES "${PATCHES_DESIRED_HASH}")
|
||||
- message(FATAL_ERROR "Patch hash actual '${PATCHES_ACTUAL_HASH}' does not match desired '${PATCHES_DESIRED_HASH}'")
|
||||
- endif()
|
||||
-
|
||||
- foreach (PATCH ${PONY_LLVM_PATCHES})
|
||||
- message(" Checking ${PATCH}")
|
||||
- execute_process(COMMAND ${GIT_EXECUTABLE} apply --check -p 1 --ignore-whitespace --whitespace=nowarn ${PATCH}
|
||||
- WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/llvm/src"
|
||||
- ERROR_VARIABLE _err_out
|
||||
- RESULT_VARIABLE git_apply_check_result)
|
||||
- if(git_apply_check_result EQUAL "0")
|
||||
- message(" Applying ${PATCH}")
|
||||
- execute_process(COMMAND ${GIT_EXECUTABLE} apply -p 1 --ignore-whitespace --whitespace=nowarn ${PATCH}
|
||||
- WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/llvm/src"
|
||||
- RESULT_VARIABLE git_apply_result)
|
||||
- if(NOT git_apply_result EQUAL "0")
|
||||
- message(FATAL_ERROR "Unable to apply ${PATCH}")
|
||||
- endif()
|
||||
- else()
|
||||
- message(" Already applied ${PATCH}")
|
||||
- endif()
|
||||
- endforeach()
|
||||
-else()
|
||||
- message(FATAL_ERROR "Git not found!")
|
||||
-endif()
|
||||
-
|
||||
message("Building targets: ${LLVM_TARGETS_TO_BUILD}")
|
||||
|
||||
set(LLVM_ENABLE_BINDINGS OFF)
|
||||
25
pkgs/development/compilers/ponyc/pony-corral.nix
Normal file
25
pkgs/development/compilers/ponyc/pony-corral.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, stdenv, fetchFromGitHub, ponyc }:
|
||||
|
||||
stdenv.mkDerivation ( rec {
|
||||
pname = "corral";
|
||||
version = "0.5.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ponylang";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-OLA09C/6s2PyzreBvqFfzsoRDXiRMbdf3Jgnmawr7k4=";
|
||||
};
|
||||
|
||||
buildInputs = [ ponyc ];
|
||||
|
||||
installFlags = [ "prefix=${placeholder "out"}" "install" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Corral is a dependency management tool for ponylang (ponyc)";
|
||||
homepage = "https://www.ponylang.io";
|
||||
license = licenses.bsd2;
|
||||
maintainers = with maintainers; [ redvers ];
|
||||
platforms = [ "x86_64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue