From ee44c1638e54ba6d9090c6a8f68fbc03c59dd6d4 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Mon, 21 Jul 2025 18:31:18 -0700 Subject: [PATCH 1/2] ftdi1: fix pkg-config libdir entry duplicate output paths --- pkgs/by-name/li/libftdi1/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/li/libftdi1/package.nix b/pkgs/by-name/li/libftdi1/package.nix index cc0fb6d3c248..4286550068e5 100644 --- a/pkgs/by-name/li/libftdi1/package.nix +++ b/pkgs/by-name/li/libftdi1/package.nix @@ -87,6 +87,11 @@ stdenv.mkDerivation { cp -r doc/html "$out/share/doc/libftdi1/" ''; + preFixup = '' + substituteInPlace $out/lib/pkgconfig/libftdi1.pc --replace-fail "libdir=$out/$out/lib" "libdir=$out/lib" + substituteInPlace $out/lib/pkgconfig/libftdipp1.pc --replace-fail "libdir=$out/$out/lib" "libdir=$out/lib" + ''; + meta = with lib; { description = "Library to talk to FTDI chips using libusb"; homepage = "https://www.intra2net.com/en/developer/libftdi/"; From 1f06af6dfa92fccb9c32741da4569be32cbd6587 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sun, 20 Jul 2025 15:55:07 -0700 Subject: [PATCH 2/2] bcu: init at 1.1.119 bcu is a remote control tool for NXP i.MX boards --- pkgs/by-name/bc/bcu/darwin-install.patch | 10 ++++ pkgs/by-name/bc/bcu/package.nix | 63 ++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 pkgs/by-name/bc/bcu/darwin-install.patch create mode 100644 pkgs/by-name/bc/bcu/package.nix diff --git a/pkgs/by-name/bc/bcu/darwin-install.patch b/pkgs/by-name/bc/bcu/darwin-install.patch new file mode 100644 index 000000000000..4d0e7bd35bf6 --- /dev/null +++ b/pkgs/by-name/bc/bcu/darwin-install.patch @@ -0,0 +1,10 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0d6b915..0a004f7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -32,4 +32,5 @@ elseif (MACOS) + link_directories(${LIBUSB_LIBRARY_DIRS} ${LIBFTDI_LIBRARY_DIRS} ${LIBYAML_LIBRARY_DIRS}) + target_link_libraries (bcu_mac ${LIBUSB_LIBDIR}/lib${LIBUSB_LIBRARIES}.dylib ${LIBFTDI_LIBDIR}/${LIBFTDI_MODULE_NAME}.dylib ${LIBYAML_LIBDIR}/lib${LIBYAML_LIBRARIES}.dylib -lpthread -lm) + execute_process( COMMAND sh ${PROJECT_SOURCE_DIR}/create_version_h.sh ${PROJECT_SOURCE_DIR} ) ++ install(TARGETS bcu_mac DESTINATION bin) + endif () diff --git a/pkgs/by-name/bc/bcu/package.nix b/pkgs/by-name/bc/bcu/package.nix new file mode 100644 index 000000000000..5f6c6449c7cb --- /dev/null +++ b/pkgs/by-name/bc/bcu/package.nix @@ -0,0 +1,63 @@ +{ + cmake, + fetchFromGitHub, + lib, + libftdi1, + libusb1, + libyaml, + ncurses, + nix-update-script, + pkg-config, + stdenv, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "bcu"; + version = "1.1.119"; + + src = fetchFromGitHub { + owner = "nxp-imx"; + repo = "bcu"; + tag = "bcu_${finalAttrs.version}"; + hash = "sha256-GVnUkIoqHED/9c3Tr4M29DB+t6Q8OPDcxVWKNn/lU/8="; + }; + + patches = [ ./darwin-install.patch ]; + + postPatch = '' + substituteInPlace create_version_h.sh \ + --replace-fail "version=\`git describe --tags --long\`" "version=${finalAttrs.src.tag}" + ''; + + enableParallelBuilding = true; + strictDeps = true; + + nativeBuildInputs = [ + cmake + pkg-config + ]; + + buildInputs = [ + libftdi1 + libusb1 + libyaml + ncurses + ]; + + passthru.updateScript = nix-update-script { }; + + env.NIX_CFLAGS_COMPILE = "-Wno-pointer-sign -Wno-deprecated-declarations -Wno-switch"; + + preFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' + ln -sf $out/bin/bcu_mac $out/bin/bcu + ''; + + meta = { + description = "NXP i.MX remote control and power measurement tools"; + homepage = "https://github.com/nxp-imx/bcu"; + license = lib.licenses.bsd3; + mainProgram = "bcu"; + maintainers = [ lib.maintainers.jmbaur ]; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + }; +})