diff options
author | Vladimír Čunát <v@cunat.cz> | 2024-05-05 17:31:58 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2024-05-05 17:31:58 +0200 |
commit | 93947b281226d5d89a39073b10caaf6c906070aa (patch) | |
tree | d55f8944fd90a3dd0d86e0f495f3d0bbdf795060 /pkgs/by-name | |
parent | 5dc079ed333c755fe000f2b86e97bf11f6f069a4 (diff) | |
parent | 100509c030faf7cca1582c5a7197b8d3a815d600 (diff) |
Merge branch 'staging' into staging-next
Diffstat (limited to 'pkgs/by-name')
-rw-r--r-- | pkgs/by-name/at/atf/package.nix | 89 | ||||
-rw-r--r-- | pkgs/by-name/bl/bluez/package.nix | 7 | ||||
-rw-r--r-- | pkgs/by-name/fr/frankenphp/package.nix | 3 | ||||
-rw-r--r-- | pkgs/by-name/in/incus/generic.nix | 8 | ||||
-rw-r--r-- | pkgs/by-name/ky/kyua/kyua-check-hook.sh | 10 | ||||
-rw-r--r-- | pkgs/by-name/ky/kyua/package.nix | 119 | ||||
-rw-r--r-- | pkgs/by-name/li/libiconv-darwin/meson.build | 303 | ||||
-rw-r--r-- | pkgs/by-name/li/libiconv-darwin/meson.options | 1 | ||||
-rw-r--r-- | pkgs/by-name/li/libiconv-darwin/nixpkgs_test.c | 82 | ||||
-rw-r--r-- | pkgs/by-name/li/libiconv-darwin/package.nix | 95 | ||||
-rw-r--r-- | pkgs/by-name/lu/lutok/package.nix | 87 | ||||
-rw-r--r-- | pkgs/by-name/lx/lxd-unwrapped-lts/package.nix | 7 | ||||
-rw-r--r-- | pkgs/by-name/ne/neovim-unwrapped/package.nix | 2 |
13 files changed, 797 insertions, 16 deletions
diff --git a/pkgs/by-name/at/atf/package.nix b/pkgs/by-name/at/atf/package.nix new file mode 100644 index 0000000000000..a9810826dc89c --- /dev/null +++ b/pkgs/by-name/at/atf/package.nix @@ -0,0 +1,89 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + autoreconfHook, + kyua, + pkg-config, + gitUpdater, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "atf"; + version = "0.21-unstable-2021-09-01"; # Match the commit used in FreeBSD’s port. + + src = fetchFromGitHub { + owner = "freebsd"; + repo = "atf"; + rev = "55c21b2c5fb189bbdfccb2b297bfa89236502542"; + hash = "sha256-u0YBPcoIBvqBVaytaO9feBaRnQygtzEPGJV0ItI1Vco="; + }; + + patches = [ + # Fixes use after free that causes failures in Kyua’s test suite. + # https://github.com/freebsd/atf/pull/57 + # https://github.com/freebsd/kyua/issues/223 + (fetchpatch { + name = "fix-use-after-free.patch"; + url = "https://github.com/freebsd/atf/commit/fb22f3837bcfdce5ce8b3c0e18af131bb6902a02.patch"; + hash = "sha256-p4L3sxSYfMSzwKrUDlEZpoJydbaK3Hcbvn90KlPHkic="; + }) + ]; + + postPatch = + lib.optionalString finalAttrs.doInstallCheck '' + # https://github.com/freebsd/atf/issues/61 + substituteInPlace atf-c/check_test.c \ + --replace-fail 'ATF_TP_ADD_TC(tp, build_cpp)' "" + substituteInPlace atf-c++/check_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, build_cpp);' "" + # Can’t find `c_helpers` in the work folder. + substituteInPlace test-programs/Kyuafile \ + --replace-fail 'atf_test_program{name="srcdir_test"}' "" + '' + # These tests fail on Darwin. + + lib.optionalString (finalAttrs.doInstallCheck && stdenv.isDarwin) '' + substituteInPlace atf-c/detail/process_test.c \ + --replace-fail 'ATF_TP_ADD_TC(tp, status_coredump);' "" + '' + # This test fails on Linux. + + lib.optionalString (finalAttrs.doInstallCheck && stdenv.isLinux) '' + substituteInPlace atf-c/detail/fs_test.c \ + --replace-fail 'ATF_TP_ADD_TC(tp, eaccess);' "" + ''; + + strictDeps = true; + + nativeBuildInputs = [ autoreconfHook ]; + + enableParallelBuilding = true; + + makeFlags = [ + # ATF isn’t compatible with C++17, which is the default on current clang and GCC. + "CXXFLAGS=-std=c++11" + ]; + + doInstallCheck = true; + + nativeInstallCheckInputs = [ kyua ]; + + installCheckPhase = '' + runHook preInstallCheck + HOME=$TMPDIR PATH=$out/bin:$PATH kyua test + runHook postInstallCheck + ''; + + passthru.updateScript = gitUpdater { rev-prefix = "atf-"; }; + + __structuredAttrs = true; + + meta = { + description = "Libraries to write tests in C, C++, and shell"; + homepage = "https://github.com/freebsd/atf/"; + license = lib.licenses.bsd3; + mainProgram = "atf-sh"; + maintainers = with lib.maintainers; [ reckenrode ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/bl/bluez/package.nix b/pkgs/by-name/bl/bluez/package.nix index f23f333a79da9..454d677d907fc 100644 --- a/pkgs/by-name/bl/bluez/package.nix +++ b/pkgs/by-name/bl/bluez/package.nix @@ -18,11 +18,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "bluez"; - version = "5.72"; + version = "5.75"; src = fetchurl { url = "mirror://kernel/linux/bluetooth/bluez-${finalAttrs.version}.tar.xz"; - hash = "sha256-SZ1/o0WplsG7ZQ9cZ0nh2SkRH6bs4L4OmGh/7mEkU24="; + hash = "sha256-mIyzxFUfbjpmdwilePXKn5P8iWUI+Y8IcJvk+KsDPC8="; }; patches = @@ -50,7 +50,6 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ docutils pkg-config - python3.pkgs.pygments python3.pkgs.wrapPython ]; @@ -138,7 +137,7 @@ stdenv.mkDerivation (finalAttrs: { ln -s ../libexec/bluetooth/obexd $out/sbin/obexd # Add extra configuration - mkdir $out/etc/bluetooth + rm $out/etc/bluetooth/{main,input,network}.conf ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf # https://github.com/NixOS/nixpkgs/issues/204418 diff --git a/pkgs/by-name/fr/frankenphp/package.nix b/pkgs/by-name/fr/frankenphp/package.nix index e293e5c48fa3b..366a115793e6e 100644 --- a/pkgs/by-name/fr/frankenphp/package.nix +++ b/pkgs/by-name/fr/frankenphp/package.nix @@ -7,6 +7,7 @@ , testers , frankenphp , darwin +, libiconv , pkg-config , makeBinaryWrapper , runCommand @@ -64,7 +65,7 @@ in buildGoModule rec { '' + lib.optionalString stdenv.isDarwin '' # replace hard-code homebrew path substituteInPlace ../frankenphp.go \ - --replace "-L/opt/homebrew/opt/libiconv/lib" "-L${darwin.libiconv}/lib" + --replace "-L/opt/homebrew/opt/libiconv/lib" "-L${libiconv}/lib" ''; preFixup = '' diff --git a/pkgs/by-name/in/incus/generic.nix b/pkgs/by-name/in/incus/generic.nix index cf73d366e10c8..dacbe6e96e3f1 100644 --- a/pkgs/by-name/in/incus/generic.nix +++ b/pkgs/by-name/in/incus/generic.nix @@ -81,7 +81,8 @@ buildGoModule rec { make incus-agent incus-migrate ''; - preCheck = + # Disable tests requiring local operations + checkFlags = let skippedTests = [ "TestValidateConfig" @@ -91,10 +92,7 @@ buildGoModule rec { "TestContainerTestSuite" ]; in - '' - # Disable tests requiring local operations - buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]") - ''; + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; postInstall = '' installShellCompletion --cmd incus \ diff --git a/pkgs/by-name/ky/kyua/kyua-check-hook.sh b/pkgs/by-name/ky/kyua/kyua-check-hook.sh new file mode 100644 index 0000000000000..0e8f724d5b4ea --- /dev/null +++ b/pkgs/by-name/ky/kyua/kyua-check-hook.sh @@ -0,0 +1,10 @@ +kyuaCheckPhase() { + runHook preCheck + # Kyua expects to save test results in ~/.kyua/store + HOME=$TMPDIR kyua test + runHook postCheck +} + +if [ -z "${dontUseKyuaCheck-}" ] && [ -z "${checkPhase-}" ]; then + checkPhase=kyuaCheckPhase +fi diff --git a/pkgs/by-name/ky/kyua/package.nix b/pkgs/by-name/ky/kyua/package.nix new file mode 100644 index 0000000000000..6209c20480373 --- /dev/null +++ b/pkgs/by-name/ky/kyua/package.nix @@ -0,0 +1,119 @@ +{ + lib, + stdenv, + fetchFromGitHub, + atf, + autoreconfHook, + lutok, + pkg-config, + sqlite, + gitUpdater, +}: + +let + # Avoid an infinite recursion (because ATF uses Kyua for testing). + atf' = atf.overrideAttrs (_: { + doInstallCheck = false; + }); +in +stdenv.mkDerivation (finalAttrs: { + pname = "kyua"; + version = "0.13-unstable-2024-01-22"; # Match the commit used in FreeBSD’s port. + + src = fetchFromGitHub { + owner = "freebsd"; + repo = "kyua"; + rev = "c85354e09ad93a902c9e8a701c042c045ec2a5b7"; + hash = "sha256-fZ0WFgOTj8Gw8IT5O8DnuaNyZscKpg6B94m+l5UoZGc"; + }; + + setupHooks = ./kyua-check-hook.sh; + + postPatch = + '' + # Fix a linking error on Darwin. Embedding an archive in an archive isn’t portable. + substituteInPlace cli/Makefile.am.inc \ + --replace-fail 'libcli_a_LIBADD = libutils.a' "" \ + --replace-fail 'CLI_LIBS = ' 'CLI_LIBS = libutils.a ' + '' + # These tests fail on Darwin or are unreliable. + + lib.optionalString (finalAttrs.doInstallCheck && stdenv.isDarwin) '' + sed -i utils/process/Makefile.am.inc -e '/executor_pid_test/d' + substituteInPlace utils/process/Kyuafile \ + --replace-fail 'atf_test_program{name="executor_pid_test"}' "" + substituteInPlace engine/atf_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, test__body_only__crashes);' "" + substituteInPlace engine/scheduler_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, integration__stacktrace);' "" + substituteInPlace utils/stacktrace_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, unlimit_core_size);' "" + substituteInPlace utils/process/isolation_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, isolate_child__enable_core_dumps);' "" + substituteInPlace utils/process/operations_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, terminate_self_with__termsig_and_core);' "" + substituteInPlace utils/process/status_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, integration__coredump);' "" + substituteInPlace integration/cmd_test_test.sh \ + --replace-fail 'atf_add_test_case premature_exit' "" + '' + # fchflags and UF_NOUNLINK are not supported on Linux. Other tests also fail. + + lib.optionalString (finalAttrs.doInstallCheck && stdenv.isLinux) '' + sed -i utils/process/Makefile.am.inc -e '/executor_pid_test/d' + substituteInPlace utils/process/Kyuafile \ + --replace-fail 'atf_test_program{name="executor_pid_test"}' "" + substituteInPlace engine/atf_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, test__body_only__crashes);' "" + substituteInPlace utils/stacktrace_test.cpp \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, dump_stacktrace__ok);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, dump_stacktrace_if_available__append);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, find_core__found__long);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, find_core__found__short);' "" \ + --replace-fail 'ATF_ADD_TEST_CASE(tcs, unlimit_core_size__hard_is_zero);' "" + substituteInPlace integration/cmd_test_test.sh \ + --replace-fail 'atf_add_test_case premature_exit' "" + ''; + + strictDeps = true; + + buildInputs = [ + lutok + sqlite + ]; + + nativeBuildInputs = [ + atf' + autoreconfHook + pkg-config + ]; + + enableParallelBuilding = true; + + makeFlags = [ + # Kyua isn’t compatible with C++17, which is the default on current clang and GCC. + "CXXFLAGS=-std=c++11" + ]; + + doInstallCheck = true; + + installCheckInputs = [ atf' ]; + nativeInstallCheckInputs = [ sqlite ]; + + installCheckPhase = '' + runHook preInstallCheck + HOME=$TMPDIR PATH=$out/bin:$PATH kyua test + runHook postInstallCheck + ''; + + passthru.updateScript = gitUpdater { rev-prefix = "kyua-"; }; + + __structuredAttrs = true; + + meta = { + description = "Testing framework for infrastructure software"; + homepage = "https://github.com/freebsd/kyua/"; + license = lib.licenses.bsd3; + mainProgram = "kyua"; + maintainers = with lib.maintainers; [ reckenrode ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/li/libiconv-darwin/meson.build b/pkgs/by-name/li/libiconv-darwin/meson.build new file mode 100644 index 0000000000000..99adeb7fe0849 --- /dev/null +++ b/pkgs/by-name/li/libiconv-darwin/meson.build @@ -0,0 +1,303 @@ +# Build settings based on the upstream Xcode project. +# See: https://github.com/apple-oss-distributions/libiconv/blob/main/libiconv.xcodeproj/project.pbxproj + +# Project settings +project('libiconv', 'c', version : '@version@') + +fs = import('fs') + + +# Dependencies +cc = meson.get_compiler('c') + + +# Definitions +prefix_libdir = get_option('prefix') / get_option('libdir') +prefix_datadir = get_option('prefix') / get_option('datadir') + +i18nmoduledir = prefix_libdir / 'i18n' +esdbdir = prefix_datadir / 'i18n/esdb' +csmapperdir = prefix_datadir / 'i18n/csmapper' + + +# Libraries +libcharset = library( + 'charset', + darwin_versions : '1', + install : true, + include_directories : ['libcharset'], + sources : [ + 'libcharset/libcharset.c' + ], + soversion : '1' +) +install_headers( + 'libcharset/libcharset.h', + 'libcharset/localcharset.h' +) + +libiconv = library( + 'iconv', + build_rpath : fs.parent(libcharset.full_path()), + c_args : [ + f'-D_PATH_I18NMODULE="@i18nmoduledir@"', + f'-D_PATH_ESDB="@esdbdir@"', + f'-D_PATH_CSMAPPER="@csmapperdir@"' + ], + darwin_versions : '7', + install : true, + include_directories : ['citrus', 'libcharset'], + link_args : ['-Wl,-reexport_library', fs.name(libcharset.full_path())], + link_depends : [libcharset], + override_options : {'b_asneeded' : false}, # Make sure the libcharset reexport is not stripped + sources : [ + 'citrus/__iconv_get_list.c', + 'citrus/__iconv_free_list.c', + 'citrus/__iconv.c', + 'citrus/bsd_iconv.c', + 'citrus/citrus_bcs_strtol.c', + 'citrus/citrus_bcs_strtoul.c', + 'citrus/citrus_bcs.c', + 'citrus/citrus_csmapper.c', + 'citrus/citrus_db.c', + 'citrus/citrus_db_factory.c', + 'citrus/citrus_db_hash.c', + 'citrus/citrus_esdb.c', + 'citrus/citrus_hash.c', + 'citrus/citrus_iconv.c', + 'citrus/citrus_lookup_factory.c', + 'citrus/citrus_lookup.c', + 'citrus/citrus_mapper.c', + 'citrus/citrus_memstream.c', + 'citrus/citrus_mmap.c', + 'citrus/citrus_module.c', + 'citrus/citrus_none.c', + 'citrus/citrus_pivot_factory.c', + 'citrus/citrus_prop.c', + 'citrus/citrus_stdenc.c', + 'citrus/iconv_canonicalize.c', + 'citrus/iconv_close.c', + 'citrus/iconv_compat.c', + 'citrus/iconv_open_into.c', + 'citrus/iconv_open.c', + 'citrus/iconv_set_relocation_prefix.c', + 'citrus/iconvctl.c', + 'citrus/iconvlist.c', + 'citrus/iconv.c', + ], + soversion : '2' +) +install_headers( + 'citrus/iconv.h' +) +install_man( + 'citrus/__iconv_get_list.3', + 'citrus/iconv_canonicalize.3', + 'citrus/iconv.3', + 'citrus/iconvctl.3', + 'citrus/iconvlist.3', +) + + +# Binaries +executable( + 'iconv', + install : true, + include_directories : ['citrus', 'libcharset'], + link_with : [libiconv], + sources : [ + 'iconv/iconv.c' + ] +) +install_man('iconv/iconv.1') + + +# Data +## csmapper +csmapper_modules = [ + 'APPLE', + 'AST', + 'BIG5', + 'CNS', + 'CP', + 'EBCDIC', + 'GB', + 'GEORGIAN', + 'ISO-8859', + 'ISO646', + 'JIS', + 'KAZAKH', + 'KOI', + 'KS', + 'MISC', + 'TCVN' +] + +foreach module : csmapper_modules + mps_files = run_command( + 'find', 'i18n/csmapper' / module, '-regex', '.*\\.\\(mps\\|646\\)', + check : true + ).stdout().strip().split('\n') + install_data(mps_files, install_dir : csmapperdir / module) +endforeach + +install_data( + 'i18n/csmapper/charset.pivot', + 'i18n/csmapper/charset.pivot.pvdb', + 'i18n/csmapper/mapper.dir', + 'i18n/csmapper/mapper.dir.db', + install_dir : csmapperdir +) + +## esdb +esdb_modules = [ + 'APPLE', + 'AST', + 'BIG5', + 'CP', + 'DEC', + 'EBCDIC', + 'EUC', + 'GB', + 'GEORGIAN', + 'ISO-2022', + 'ISO-8859', + 'ISO646', + 'KAZAKH', + 'KOI', + 'MISC', + 'TCVN', + 'UTF' +] + +foreach module : esdb_modules + esdb_files = run_command( + 'find', 'i18n/esdb' / module, '-name', '*.esdb', + check : true + ).stdout().strip().split('\n') + install_data(esdb_files, install_dir : esdbdir / module) +endforeach + +install_data( + 'i18n/esdb/esdb.alias', + 'i18n/esdb/esdb.alias.db', + 'i18n/esdb/esdb.dir', + 'i18n/esdb/esdb.dir.db', + install_dir : esdbdir +) + + +# Modules +libiconv_modules = [ + 'BIG5', + 'DECHanyu', + 'DECKanji', + 'EUC', + 'EUCTW', + 'GBK2K', + 'HZ', + 'ISO2022', + 'JOHAB', + 'MSKanji', + 'UES', + 'UTF1632', + 'UTF7', + 'UTF8', + 'UTF8MAC', + 'VIQR', + 'ZW', + 'iconv_none', + 'iconv_std', + 'mapper_646', + 'mapper_none', + 'mapper_serial', + 'mapper_parallel', + 'mapper_std', + 'mapper_zone' +] + +foreach module : libiconv_modules + module_source = module.to_lower() + module_path = 'libiconv_modules' / module + + if module == 'UTF8MAC' + extra_headers = 'libiconv_modules/UTF8' + else + extra_headers = [ ] + endif + + # Upstream builds this module under both names. + # See: https://github.com/apple-oss-distributions/libiconv/blob/81be60a93521c931a01aab9c747dd2b078bc0679/libiconv.xcodeproj/project.pbxproj#L2549-L2556 + # See also: https://cgit.freebsd.org/src/tree/lib/libiconv_modules/mapper_parallel/Makefile?id=9241ebc796c11cf133c550f188f324bd2c12d89a + if module == 'mapper_parallel' + module_source = 'mapper_serial' + module_path = 'libiconv_modules/mapper_serial' + endif + + library( + module, + darwin_versions : '1', + install : true, + install_dir : i18nmoduledir, + include_directories : [module_path, 'citrus', 'libcharset'] + extra_headers, + link_with : [libiconv], + override_options : {'b_asneeded' : false}, # Upstream always links libiconv + sources : [ + module_path / f'citrus_@module_source@.c' + ] + ) +endforeach + + +# Tests +if get_option('tests') == true +## Only required for running the tests + atf = dependency('atf-c') + foreach suite : ['libiconv_test', 'mbopt_test', 'nixpkgs_test'] + test_src = f'tests/libiconv/@suite@.c' + test_exe = executable( + suite, + dependencies : [atf], + include_directories : ['citrus', 'libcharset'], + link_with : [libiconv], + sources : [test_src] + ) + + # Extract the tests to run from the test source code. + tests = run_command( + 'sed', '-n', '-E', 's|.*ATF_TP_ADD_TC\\([^,]*, ([^)]*).*$|\\1|p', test_src, + check : true + ).stdout().strip().split('\n') + + foreach test : tests + test(test, test_exe, args : [test], suite : suite, timeout : 300) + endforeach + endforeach + +# These tests depend on `os_variant_has_internal_content`, which is stubbed out. +# atf_sh = find_program('atf-sh') +# print_charset = executable( +# 'print_charset', +# include_directories : ['citrus', 'libcharset'], +# link_with : [libiconv], +# sources : 'tests/libcharset/print_charset.c' +# ) +# +# test_charset = custom_target( +# 'test_charset.sh', +# command : ['cp', '@INPUT@', '@OUTPUT@'], +# depends : print_charset, +# input : 'tests/libcharset/test_charset.sh', +# output : 'test_charset.sh' +# ) +# +# # Extract the tests to run from the test source code. +# tests = run_command( +# 'sed', '-n', '-E', 's|.*atf_add_test_case (.*$)|\\1|p', 'tests/libcharset/test_charset.sh', +# check : true +# ).stdout().strip().split('\n') +# +# foreach test : tests +# test(test, atf_sh, args : [test_charset, test], suite : 'libcharset', timeout : 300) +# endforeach +endif diff --git a/pkgs/by-name/li/libiconv-darwin/meson.options b/pkgs/by-name/li/libiconv-darwin/meson.options new file mode 100644 index 0000000000000..c75832a377a59 --- /dev/null +++ b/pkgs/by-name/li/libiconv-darwin/meson.options @@ -0,0 +1 @@ +option('tests', type : 'boolean') diff --git a/pkgs/by-name/li/libiconv-darwin/nixpkgs_test.c b/pkgs/by-name/li/libiconv-darwin/nixpkgs_test.c new file mode 100644 index 0000000000000..40400ef832832 --- /dev/null +++ b/pkgs/by-name/li/libiconv-darwin/nixpkgs_test.c @@ -0,0 +1,82 @@ +#include <atf-c.h> +#include <iconv.h> +#include <stdint.h> + +// The following tests were failing in libarchive due to libiconv issues. +// 218: test_read_format_cab_filename (4 failures) +// 415: test_read_format_zip_filename_CP932_eucJP (4 failures) +// 426: test_read_format_zip_filename_CP932_CP932 (2 failures) + +ATF_TC(test_cp932_eucjp); +ATF_TC_HEAD(test_cp932_eucjp, tc) +{ + atf_tc_set_md_var(tc, "descr", "regression test for CP932 to EUC-JP conversion"); +} +ATF_TC_BODY(test_cp932_eucjp, tc) +{ + char expected[] = "\xc9\xbd\xa4\xc0\xa4\xe8\x5c\xb4\xc1\xbb\xfa\x2e\x74\x78\x74"; + size_t expected_length = sizeof(expected) - 1; + + char input[] = "\x95\x5c\x82\xbe\x82\xe6\x5c\x8a\xbf\x8e\x9a\x2e\x74\x78\x74"; + size_t input_length = sizeof(input) - 1; + + size_t output_available = sizeof(expected) - 1 ; + char output[sizeof(expected)] = { 0 }; + + iconv_t cd = iconv_open("eucJP", "CP932"); + ATF_REQUIRE((size_t)cd != -1); + + char* input_buf = input; + char* output_buf = output; + + size_t res = iconv(cd, &input_buf, &input_length, &output_buf, &output_available); + iconv_close(cd); + + ATF_CHECK(res != -1); + + size_t output_length = sizeof(output) - output_available - 1; + + ATF_CHECK_INTEQ(expected_length, output_length); + ATF_CHECK_STREQ(expected, output); +} + +ATF_TC(test_cp932_cp932); +ATF_TC_HEAD(test_cp932_cp932, tc) +{ + atf_tc_set_md_var(tc, "descr", "regression test for CP932 to CP932 conversion"); +} +ATF_TC_BODY(test_cp932_cp932, tc) +{ + char expected[] = "\x95\x5c\x82\xbe\x82\xe6\x5c\x8a\xbf\x8e\x9a\x2e\x74\x78\x74"; + size_t expected_length = sizeof(expected) - 1; + + char input[] = "\x95\x5c\x82\xbe\x82\xe6\x5c\x8a\xbf\x8e\x9a\x2e\x74\x78\x74"; + size_t input_length = sizeof(input) - 1; + + size_t output_available = sizeof(expected) - 1 ; + char output[sizeof(expected)] = { 0 }; + + iconv_t cd = iconv_open("CP932", "CP932"); + ATF_REQUIRE((size_t)cd != -1); + + char* input_buf = input; + char* output_buf = output; + + size_t res = iconv(cd, &input_buf, &input_length, &output_buf, &output_available); + iconv_close(cd); + + ATF_CHECK(res != -1); + + size_t output_length = sizeof(output) - output_available - 1; + + ATF_CHECK_INTEQ(expected_length, output_length); + ATF_CHECK_STREQ(expected, output); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, test_cp932_eucjp); + ATF_TP_ADD_TC(tp, test_cp932_cp932); + + return atf_no_error(); +} diff --git a/pkgs/by-name/li/libiconv-darwin/package.nix b/pkgs/by-name/li/libiconv-darwin/package.nix new file mode 100644 index 0000000000000..bb5291831b655 --- /dev/null +++ b/pkgs/by-name/li/libiconv-darwin/package.nix @@ -0,0 +1,95 @@ +{ + lib, + stdenv, + fetchFromGitHub, + fetchpatch, + atf, + libiconvReal, + meson, + ninja, + pkg-config, + gitUpdater, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "libiconv"; + version = "99"; + + outputs = [ + "out" + "dev" + ]; + + src = fetchFromGitHub { + owner = "apple-oss-distributions"; + repo = "libiconv"; + rev = "libiconv-${finalAttrs.version}"; + hash = "sha256-TGt6rsU52ztfW2rCqwnhMAExLbexI/59IoDOGY+XGu0="; + }; + + inherit (libiconvReal) setupHooks; + + postPatch = + '' + substitute ${./meson.build} meson.build --subst-var version + cp ${./meson.options} meson.options + + # Work around unnecessary private API usage in libcharset + mkdir -p libcharset/os && cat <<-header > libcharset/os/variant_private.h + #pragma once + #include <stdbool.h> + static inline bool os_variant_has_internal_content(const char*) { return false; } + header + + cp ${./nixpkgs_test.c} tests/libiconv/nixpkgs_test.c + ''; + + strictDeps = true; + + nativeBuildInputs = [ + meson + ninja + ]; + + mesonBuildType = "release"; + + mesonFlags = [ (lib.mesonBool "tests" finalAttrs.doInstallCheck) ]; + + postInstall = lib.optionalString stdenv.isDarwin '' + ${stdenv.cc.targetPrefix}install_name_tool "$out/lib/libiconv.2.dylib" \ + -change '@rpath/libcharset.1.dylib' "$out/lib/libcharset.1.dylib" + ''; + + # Tests have to be run in `installCheckPhase` because libiconv expects to `dlopen` + # modules from `$out/lib/i18n`. + nativeInstallCheckInputs = [ pkg-config ]; + installCheckInputs = [ atf ]; + + doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + # Can’t use `mesonCheckPhase` because it runs the wrong hooks for `installCheckPhase`. + installCheckPhase = '' + runHook preInstallCheck + meson test --no-rebuild + runHook postInstallCheck + ''; + + passthru.updateScript = gitUpdater { rev-prefix = "libiconv-"; }; + + __structuredAttrs = true; + + meta = { + description = "An iconv(3) implementation"; + homepage = "https://opensource.apple.com/releases/"; + license = + with lib.licenses; + [ + bsd2 + bsd3 + ] + ++ lib.optional finalAttrs.doInstallCheck apsl10; + mainProgram = "iconv"; + maintainers = with lib.maintainers; [ reckenrode ]; + platforms = lib.platforms.darwin; + }; +}) diff --git a/pkgs/by-name/lu/lutok/package.nix b/pkgs/by-name/lu/lutok/package.nix new file mode 100644 index 0000000000000..a09724b5348f9 --- /dev/null +++ b/pkgs/by-name/lu/lutok/package.nix @@ -0,0 +1,87 @@ +{ + lib, + stdenv, + fetchFromGitHub, + atf, + autoreconfHook, + kyua, + lua, + pkg-config, + gitUpdater, +}: + +lib.fix ( + drv: + let + # Avoid infinite recursions: + # - Lutok depends on ATF and Kyua for testing; but + # - ATF depends on Kyua for testing, and Kyua depends on Lutok as a build input. + # To break the cycle (ATF -> Kyua -> Lutok -> ATF and Kyua): + # - Build ATF without testing (avoiding the Kyua dependency); and + # - Build Kyua against a version of Lutok without testing (also avoiding the ATF and Kyua dependencies). + atf' = atf.overrideAttrs (_: { + doInstallCheck = false; + }); + kyua' = + (kyua.override { + lutok = drv.overrideAttrs (_: { + doCheck = false; + }); + }).overrideAttrs + (_: { + # Assume Kyua’s install check phase will run when Kyua is built. Don’t run it again + # while building Lutok because it can take four to five minutes to run. + doInstallCheck = false; + }); + in + stdenv.mkDerivation (finalAttrs: { + pname = "lutok"; + version = "0.4"; + + outputs = [ + "out" + "dev" + ]; + + src = fetchFromGitHub { + owner = "freebsd"; + repo = "lutok"; + rev = "lutok-${finalAttrs.version}"; + hash = "sha256-awAFxx9q8dZ6JO1/mShjhJnOPTLn1wCT4VrB4rlgWyg="; + }; + + strictDeps = true; + + propagatedBuildInputs = [ lua ]; + + nativeBuildInputs = [ + atf' + autoreconfHook + pkg-config + ]; + + enableParallelBuilding = true; + + makeFlags = [ + # Lutok isn’t compatible with C++17, which is the default on current clang and GCC. + "CXXFLAGS=-std=c++11" + ]; + + doCheck = true; + + checkInputs = [ atf' ]; + nativeCheckInputs = [ kyua' ]; + + passthru.updateScript = gitUpdater { rev-prefix = "lutok-"; }; + + __structuredAttrs = true; + + meta = { + description = "Libraries to write tests in C, C++, and shell"; + homepage = "https://github.com/freebsd/lutok/"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ reckenrode ]; + platforms = lib.platforms.unix; + }; + }) +) diff --git a/pkgs/by-name/lx/lxd-unwrapped-lts/package.nix b/pkgs/by-name/lx/lxd-unwrapped-lts/package.nix index c11ece294dc17..41b20f4860687 100644 --- a/pkgs/by-name/lx/lxd-unwrapped-lts/package.nix +++ b/pkgs/by-name/lx/lxd-unwrapped-lts/package.nix @@ -71,7 +71,7 @@ buildGo122Module rec { make lxd-agent lxd-migrate ''; - preCheck = + checkFlags = let skippedTests = [ "TestValidateConfig" @@ -81,10 +81,7 @@ buildGo122Module rec { "TestContainerTestSuite" ]; in - '' - # Disable tests requiring local operations - buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]") - ''; + [ "-skip=^${builtins.concatStringsSep "$|^" skippedTests}$" ]; postInstall = '' installShellCompletion --bash --name lxd ./scripts/bash/lxd-client diff --git a/pkgs/by-name/ne/neovim-unwrapped/package.nix b/pkgs/by-name/ne/neovim-unwrapped/package.nix index b29e020cbf612..0dd8ca8a0877b 100644 --- a/pkgs/by-name/ne/neovim-unwrapped/package.nix +++ b/pkgs/by-name/ne/neovim-unwrapped/package.nix @@ -148,7 +148,7 @@ in { # check that the above patching actually works disallowedRequisites = [ stdenv.cc ] ++ lib.optional (lua != codegenLua) codegenLua; - cmakeFlags = [ + cmakeFlagsArray = [ # Don't use downloaded dependencies. At the end of the configurePhase one # can spot that cmake says this option was "not used by the project". # That's because all dependencies were found and |