From e0bb6391a9bd55f3856fa45f23a7891d29b834ad Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 27 Jun 2020 15:57:12 +0200 Subject: gnu: ilmbase: Update to 2.5.2. * gnu/packages/patches/ilmbase-fix-test-arm.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/graphics.scm (ilmbase): Update to 2.5.2. [source](patches): Remove 'ilmbase-fix-test-arm.patch'. (openexr)[arguments]: Really increase test timeout, as the previous fix was ineffective. --- gnu/packages/patches/ilmbase-fix-test-arm.patch | 60 ------------------------- 1 file changed, 60 deletions(-) delete mode 100644 gnu/packages/patches/ilmbase-fix-test-arm.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/ilmbase-fix-test-arm.patch b/gnu/packages/patches/ilmbase-fix-test-arm.patch deleted file mode 100644 index 2dbc55e8c4..0000000000 --- a/gnu/packages/patches/ilmbase-fix-test-arm.patch +++ /dev/null @@ -1,60 +0,0 @@ -Fix a test failure on ARM platforms: - -https://github.com/AcademySoftwareFoundation/openexr/issues/713 - -Taken from upstream: - -https://github.com/AcademySoftwareFoundation/openexr/commit/76d9839cd1b300398f8b801dfcb4bcf2f8c0096f - -diff --git a/OpenEXR/IlmImfTest/testHuf.cpp b/OpenEXR/IlmImfTest/testHuf.cpp -index 4c887ee8..a93b8ea9 100644 ---- a/OpenEXR/IlmImfTest/testHuf.cpp -+++ b/OpenEXR/IlmImfTest/testHuf.cpp -@@ -181,9 +181,9 @@ compressUncompressSubset(const unsigned short raw[], int n) - // This DEK hash is determined from an aprior initial run of this - // test noting its value from the assert message compressVerify(). - // --#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2956869585U --#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 3414126535U --#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 169791374U -+#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_USHRT_MAX_PLUS_ONE 2013380646U -+#define HUF_COMPRESS_DEK_HASH_FOR_FILL4_N 213880353U -+#define HUF_COMPRESS_DEK_HASH_FOR_FILL5_N 2492982090U - - void - compressVerify (const unsigned short raw[], -@@ -200,7 +200,7 @@ compressVerify (const unsigned short raw[], - // under the topic of sorting and search chapter 6.4. - // - unsigned int compressedHash = nCompressed; -- const char* cptr = compressed; -+ const unsigned char* cptr = reinterpret_cast( (const char*) compressed); - for (int i = 0; i < nCompressed; ++i) - { - compressedHash = -@@ -210,6 +210,25 @@ compressVerify (const unsigned short raw[], - cout << "verifying compressed checksum hash = " - << compressedHash << std::endl; - -+ if (compressedHash != dekHash) -+ { -+ cout << "hash verification failed. Got " << compressedHash << " expected " << dekHash << std::endl; -+ const unsigned char* cptr = reinterpret_cast( (const char*) compressed); -+ for(int i = 0 ; i < nCompressed ; ++i ) -+ { -+ cout << std::hex << (0xFF & (int) (*cptr++)); -+ if ( (i & 0xF) ==0 ) -+ { -+ cout << '\n'; -+ } -+ else -+ { -+ cout << ' '; -+ } -+ } -+ cout << "\n"; -+ } -+ - assert (compressedHash == dekHash); - } - -- cgit v1.2.3 From afdc16d9041fde77913b6e84679dc581c54df2d6 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sat, 27 Jun 2020 16:48:20 +0200 Subject: gnu: x265: Update to 3.4. * gnu/packages/patches/x265-arm-flags.patch: Update patch. * gnu/packages/video.scm (x265): Update to 3.4. [arguments]: Remove obsolete substitution. Disable the newly-added assembly optimizations on AArch64, as they are not implemented for all targets we build. --- gnu/packages/patches/x265-arm-flags.patch | 38 +++++++++++++++---------------- gnu/packages/video.scm | 10 +++----- 2 files changed, 22 insertions(+), 26 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/x265-arm-flags.patch b/gnu/packages/patches/x265-arm-flags.patch index f17e26f6f1..342e13270b 100644 --- a/gnu/packages/patches/x265-arm-flags.patch +++ b/gnu/packages/patches/x265-arm-flags.patch @@ -1,4 +1,7 @@ -https://sources.debian.org/src/x265/2.9-3/debian/patches/0001-Fix-arm-flags.patch/ +Fix build flags for ARMv7. + +Taken from Debian: +https://salsa.debian.org/multimedia-team/x265/-/blob/master/debian/patches/0001-Fix-arm-flags.patch From: Sebastian Ramacher Date: Wed, 26 Apr 2017 22:05:06 +0200 @@ -9,28 +12,25 @@ Subject: Fix arm* flags 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt -index 33b6523..25aecbb 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt -@@ -72,7 +72,7 @@ elseif(ARMMATCH GREATER "-1") +@@ -77,7 +77,7 @@ elseif(ARMMATCH GREATER "-1") + add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=1 -DHAVE_ARMV6=0) + else() + message(STATUS "Detected ARM target processor") +- add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=1) ++ add_definitions(-DX265_ARCH_ARM=1) endif() - message(STATUS "Detected ARM target processor") - set(ARM 1) -- add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1) -+ # add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1) else() message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown") - message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}") -@@ -230,12 +230,8 @@ if(GCC) - if(ARM AND CROSS_COMPILE_ARM) - set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) - elseif(ARM) -- find_package(Neon) - if(CPU_HAS_NEON) -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) - add_definitions(-DHAVE_NEON) -- else() -- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) +@@ -252,10 +252,7 @@ if(GCC) + else() + find_package(Neon) + if(CPU_HAS_NEON) +- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) + add_definitions(-DHAVE_NEON) +- else() +- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) + endif() endif() endif() - add_definitions(${ARM_ARGS}) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index c5e4993091..9c88066c91 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -611,7 +611,7 @@ available.") (define-public x265 (package (name "x265") - (version "3.3") + (version "3.4") (outputs '("out" "static")) (source (origin @@ -621,7 +621,7 @@ available.") (string-append "https://download.videolan.org/videolan/x265/" "x265_" version ".tar.gz"))) (sha256 - (base32 "170b61cgpcs5n35qps0p40dqs1q81vkgagzbs4zv7pzls6718vpj")) + (base32 "0wl62hfsdqpf3r3z3s6l9bz7pdb1rcik5ll00b3yaadplqipy162")) (patches (search-patches "x265-arm-flags.patch")) (modules '((guix build utils))) (snippet '(begin @@ -638,8 +638,7 @@ available.") #:configure-flags ;; Ensure position independent code for everyone. (list "-DENABLE_PIC=TRUE" - ,@(if (string-prefix? "armhf" (or (%current-system) - (%current-target-system))) + ,@(if (target-arm?) '("-DENABLE_ASSEMBLY=OFF") '()) (string-append "-DCMAKE_INSTALL_PREFIX=" @@ -650,9 +649,6 @@ available.") (lambda _ (delete-file-recursively "build") (chdir "source") - ;; recognize armv8 in 32-bit mode as ARM - (substitute* "CMakeLists.txt" - (("armv6l") "armv8l")) #t)) (add-before 'configure 'build-12-bit (lambda* (#:key (configure-flags '()) #:allow-other-keys) -- cgit v1.2.3 From 10543ef8e148f5329b41568f92e83dac3930f02b Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Mon, 29 Jun 2020 12:06:50 +0200 Subject: gnu: Add ppsspp. * gnu/packages/emulators.scm (ppsspp): New variable. * gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch: New file. * gnu/local.mk: Register it. Signed-off-by: Nicolas Goaziou --- gnu/local.mk | 1 + gnu/packages/emulators.scm | 131 ++++++++ .../patches/ppsspp-disable-upgrade-and-gold.patch | 358 +++++++++++++++++++++ 3 files changed, 490 insertions(+) create mode 100644 gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8bb56010c2..dbeec8be3c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1350,6 +1350,7 @@ dist_patch_DATA = \ %D%/packages/patches/pam-mount-luks2-support.patch \ %D%/packages/patches/pango-skip-libthai-test.patch \ %D%/packages/patches/pciutils-hurd-configure.patch \ + %D%/packages/patches/ppsspp-disable-upgrade-and-gold.patch \ %D%/packages/patches/sdl-pango-api_additions.patch \ %D%/packages/patches/sdl-pango-blit_overflow.patch \ %D%/packages/patches/sdl-pango-fillrect_crash.patch \ diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm index ae8bf18255..8b39517e3f 100644 --- a/gnu/packages/emulators.scm +++ b/gnu/packages/emulators.scm @@ -1839,3 +1839,134 @@ performance, features, and ease of use.") "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework based on QEMU.") (license license:gpl2+)))) + +(define-public ppsspp + (package + (name "ppsspp") + (version "1.10") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/hrydgard/ppsspp.git") + (commit (string-append "v" version)))) + (sha256 + (base32 "02yx1w0ygclnmdl0imsvgj24lkzi55wvxkf47q617j0jgrqhy8yl")) + (file-name (git-file-name name version)) + (patches + (search-patches "ppsspp-disable-upgrade-and-gold.patch")) + (modules '((guix build utils))) + (snippet + `(begin + ;; Unbundle sources. + (substitute* (list "Common/Vulkan/VulkanContext.cpp" + "ext/native/thin3d/vulkan_utils.cpp" + "GPU/Common/ShaderCommon.cpp" + "GPU/Common/ShaderTranslation.cpp" + "SDL/SDLMain.cpp") + (("ext/glslang/") "") + (("ext/SPIRV-Cross/") "spirv_cross/")) + ;; Patch CMakeLists. + (substitute* "CMakeLists.txt" + (("include_directories\\(ext/glslang\\)") "") + (("spirv-cross-glsl" all) + (string-append all + " spirv-cross-core spirv-cross-cpp" + " spirv-cross-reflect spirv-cross-util"))) + (substitute* "ext/CMakeLists.txt" + (("add_subdirectory\\(glslang\\)") "") + (("add_subdirectory\\(SPIRV-Cross-build\\)") "")) + (delete-file-recursively "ext/cmake") + (substitute* "git-version.cmake" + (("unknown") ,version)))))) + (build-system cmake-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python))) + (inputs + `(("ffmpeg" ,ffmpeg) + ("glew" ,glew) + ("glslang" ,glslang) + ("libpng" ,libpng) + ("mesa" ,mesa) + ("sdl2" ,sdl2) + ("snappy" ,snappy) + ("spirv-cross" ,spirv-cross) + ("zlib" ,zlib) + ;; TODO: unbundle builds. + ("armips-source" ,(package-source armips)) + ("lang" + ,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/hrydgard/ppsspp-lang.git") + (commit "d184ba2b607a03435be579406b816c90add334e6"))) + (sha256 + (base32 "0s003x6247nx09qd6a1jz1l2hsk5d6k1zmh8mg3m6hjjhvbvd9j9")))) + ("tests" + ,(origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/hrydgard/pspautotests.git") + (commit "328b839c7243e7f733f9eae88d059485e3d808e7"))) + (sha256 + (base32 "1gj1kr5ijxrqwvz7c41phskjr70ndp8iz0gr8c3xxsd8p9z5gdvm")))))) + (arguments + `(#:out-of-source? #f + #:configure-flags (list "-DUSE_DISCORD=OFF" + "-DUSE_SYSTEM_FFMPEG=ON" + ;; For testing. + "-DUNITTEST=ON" "-DHEADLESS=ON") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'add-external-sources + (lambda* (#:key inputs #:allow-other-keys) + ;; TODO: unbundle builds. Not only should we not copy these + ;; sources in, we should also remove as much from "ext/" as we + ;; can. + (copy-recursively (assoc-ref inputs "armips-source") + "ext/armips") + ;; Some tests are externalised, so we add them here. + (copy-recursively (assoc-ref inputs "tests") + "pspautotests") + ;; i18n is externalised, so we add it here. + (copy-recursively (assoc-ref inputs "lang") + "assets/lang") + #t)) + (replace 'check + (lambda _ + (for-each + (lambda (t) (invoke "./unitTest" t)) + '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin" + "SinCos" "VFPUSinCos" "MathUtil" "Parsers" "Jit" + "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ" "MemMap")) + (invoke "python3" "test.py" "-g") + #t)) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin/ppsspp (string-append out "/bin/ppsspp")) + (share (string-append out "/share/ppsspp"))) + (copy-recursively "icons/hicolor" + (string-append out "/share/icons/hicolor")) + (install-file "PPSSPPSDL" share) + (copy-recursively "assets" (string-append share "/assets")) + + (make-desktop-entry-file + (string-append out "/share/applications/ppsspp.desktop") + #:name "PPSSPP" + #:exec (string-append share "/PPSSPPSDL") + #:icon "ppsspp") + (mkdir-p (string-append out "/bin")) + (with-output-to-file bin/ppsspp + (lambda () + (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\"" + (which "sh") share))) + (chmod bin/ppsspp #o755) + #t)))))) + (home-page "https://www.ppsspp.org/") + (synopsis "PSP emulator") + (description + "PPSSPP is a ``high-level'' emulator simulating the PSP operating +system.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch b/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch new file mode 100644 index 0000000000..9503ab6f31 --- /dev/null +++ b/gnu/packages/patches/ppsspp-disable-upgrade-and-gold.patch @@ -0,0 +1,358 @@ +From 951f2269f67d618d376656db831796c119f4f6b3 Mon Sep 17 00:00:00 2001 +From: Leo Prikler +Date: Fri, 26 Jun 2020 18:20:04 +0200 +Subject: [PATCH] ppsspp: disable upgrade and gold + +--- + Core/Config.cpp | 11 ------- + Core/Config.h | 2 -- + Qt/QtMain.cpp | 6 ---- + SDL/SDLMain.cpp | 6 ---- + UI/DevScreens.cpp | 3 -- + UI/GameSettingsScreen.cpp | 1 - + UI/MainScreen.cpp | 63 +------------------------------------ + UI/MiscScreens.cpp | 31 ++---------------- + UWP/PPSSPP_UWPMain.cpp | 6 ---- + Windows/MainWindowMenu.cpp | 2 +- + Windows/main.cpp | 6 ---- + android/jni/app-android.cpp | 6 ---- + 12 files changed, 5 insertions(+), 138 deletions(-) + +diff --git a/Core/Config.cpp b/Core/Config.cpp +index 214aeb433..04e3b151d 100644 +--- a/Core/Config.cpp ++++ b/Core/Config.cpp +@@ -428,7 +428,6 @@ static ConfigSetting generalSettings[] = { + ConfigSetting("IgnoreBadMemAccess", &g_Config.bIgnoreBadMemAccess, true, true), + ConfigSetting("CurrentDirectory", &g_Config.currentDirectory, ""), + ConfigSetting("ShowDebuggerOnLoad", &g_Config.bShowDebuggerOnLoad, false), +- ConfigSetting("CheckForNewVersion", &g_Config.bCheckForNewVersion, true), + ConfigSetting("Language", &g_Config.sLanguageIni, &DefaultLangRegion), + ConfigSetting("ForceLagSync2", &g_Config.bForceLagSync, false, true, true), + ConfigSetting("DiscordPresence", &g_Config.bDiscordPresence, true, true, false), // Or maybe it makes sense to have it per-game? Race conditions abound... +@@ -1229,16 +1228,6 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { + upgradeMessage = ""; + } + +- // Check for new version on every 10 runs. +- // Sometimes the download may not be finished when the main screen shows (if the user dismisses the +- // splash screen quickly), but then we'll just show the notification next time instead, we store the +- // upgrade number in the ini. +- if (iRunCount % 10 == 0 && bCheckForNewVersion) { +- std::shared_ptr dl = g_DownloadManager.StartDownloadWithCallback( +- "http://www.ppsspp.org/version.json", "", &DownloadCompletedCallback); +- dl->SetHidden(true); +- } +- + INFO_LOG(LOADER, "Loading controller config: %s", controllerIniFilename_.c_str()); + bSaveSettings = true; + +diff --git a/Core/Config.h b/Core/Config.h +index 084eacc94..e7134cab5 100644 +--- a/Core/Config.h ++++ b/Core/Config.h +@@ -99,7 +99,6 @@ struct Config { + bool bIgnoreBadMemAccess; + bool bFastMemory; + int iCpuCore; +- bool bCheckForNewVersion; + bool bForceLagSync; + bool bFuncReplacements; + bool bHideSlowWarnings; +@@ -521,4 +520,3 @@ std::string CreateRandMAC(); + // TODO: Find a better place for this. + extern http::Downloader g_DownloadManager; + extern Config g_Config; +- +diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp +index 7713b6587..1d92d1175 100644 +--- a/Qt/QtMain.cpp ++++ b/Qt/QtMain.cpp +@@ -194,12 +194,6 @@ bool System_GetPropertyBool(SystemProperty prop) { + return true; + case SYSPROP_HAS_FILE_BROWSER: + return true; +- case SYSPROP_APP_GOLD: +-#ifdef GOLD +- return true; +-#else +- return false; +-#endif + default: + return false; + } +diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp +index 52028d087..d8697d210 100644 +--- a/SDL/SDLMain.cpp ++++ b/SDL/SDLMain.cpp +@@ -356,12 +356,6 @@ bool System_GetPropertyBool(SystemProperty prop) { + switch (prop) { + case SYSPROP_HAS_BACK_BUTTON: + return true; +- case SYSPROP_APP_GOLD: +-#ifdef GOLD +- return true; +-#else +- return false; +-#endif + default: + return false; + } +diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp +index f146d099e..625ee124c 100644 +--- a/UI/DevScreens.cpp ++++ b/UI/DevScreens.cpp +@@ -603,9 +603,6 @@ void SystemInfoScreen::CreateViews() { + #ifdef _M_SSE + buildConfig->Add(new InfoItem("_M_SSE", StringFromFormat("0x%x", _M_SSE))); + #endif +- if (System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- buildConfig->Add(new InfoItem("GOLD", "")); +- } + + ViewGroup *cpuExtensionsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT)); + cpuExtensionsScroll->SetTag("DevSystemInfoCPUExt"); +diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp +index 8202870c7..81112f822 100644 +--- a/UI/GameSettingsScreen.cpp ++++ b/UI/GameSettingsScreen.cpp +@@ -796,7 +796,6 @@ void GameSettingsScreen::CreateViews() { + } + #endif + +- systemSettings->Add(new CheckBox(&g_Config.bCheckForNewVersion, sy->T("VersionCheck", "Check for new versions of PPSSPP"))); + const std::string bgPng = GetSysDirectory(DIRECTORY_SYSTEM) + "background.png"; + const std::string bgJpg = GetSysDirectory(DIRECTORY_SYSTEM) + "background.jpg"; + if (File::Exists(bgPng) || File::Exists(bgJpg)) { +diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp +index 43535913d..36834020d 100644 +--- a/UI/MainScreen.cpp ++++ b/UI/MainScreen.cpp +@@ -1054,11 +1054,7 @@ void MainScreen::CreateViews() { + sprintf(versionString, "%s", PPSSPP_GIT_VERSION); + rightColumnItems->SetSpacing(0.0f); + LinearLayout *logos = new LinearLayout(ORIENT_HORIZONTAL); +- if (System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- logos->Add(new ImageView(ImageID("I_ICONGOLD"), IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false))); +- } else { +- logos->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false))); +- } ++ logos->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(64, 64, 10, 10, NONE, NONE, false))); + logos->Add(new ImageView(ImageID("I_LOGO"), IS_DEFAULT, new LinearLayoutParams(Margins(-12, 0, 0, 0)))); + rightColumnItems->Add(logos); + TextView *ver = rightColumnItems->Add(new TextView(versionString, new LinearLayoutParams(Margins(70, -6, 0, 0)))); +@@ -1070,11 +1066,6 @@ void MainScreen::CreateViews() { + rightColumnItems->Add(new Choice(mm->T("Game Settings", "Settings")))->OnClick.Handle(this, &MainScreen::OnGameSettings); + rightColumnItems->Add(new Choice(mm->T("Credits")))->OnClick.Handle(this, &MainScreen::OnCredits); + rightColumnItems->Add(new Choice(mm->T("www.ppsspp.org")))->OnClick.Handle(this, &MainScreen::OnPPSSPPOrg); +- if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- Choice *gold = rightColumnItems->Add(new Choice(mm->T("Buy PPSSPP Gold"))); +- gold->OnClick.Handle(this, &MainScreen::OnSupport); +- gold->SetIcon(ImageID("I_ICONGOLD")); +- } + + #if !PPSSPP_PLATFORM(UWP) + // Having an exit button is against UWP guidelines. +@@ -1099,28 +1090,6 @@ void MainScreen::CreateViews() { + } else if (tabHolder_->GetVisibility() != V_GONE) { + root_->SetDefaultFocusView(tabHolder_); + } +- +- auto u = GetI18NCategory("Upgrade"); +- +- upgradeBar_ = 0; +- if (!g_Config.upgradeMessage.empty()) { +- upgradeBar_ = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)); +- +- UI::Margins textMargins(10, 5); +- UI::Margins buttonMargins(0, 0); +- UI::Drawable solid(0xFFbd9939); +- upgradeBar_->SetBG(solid); +- upgradeBar_->Add(new TextView(u->T("New version of PPSSPP available") + std::string(": ") + g_Config.upgradeVersion, new LinearLayoutParams(1.0f, textMargins))); +- upgradeBar_->Add(new Button(u->T("Download"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDownloadUpgrade); +- upgradeBar_->Add(new Button(u->T("Dismiss"), new LinearLayoutParams(buttonMargins)))->OnClick.Handle(this, &MainScreen::OnDismissUpgrade); +- +- // Slip in under root_ +- LinearLayout *newRoot = new LinearLayout(ORIENT_VERTICAL); +- newRoot->Add(root_); +- newRoot->Add(upgradeBar_); +- root_->ReplaceLayoutParams(new LinearLayoutParams(1.0)); +- root_ = newRoot; +- } + } + + UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) { +@@ -1128,27 +1097,6 @@ UI::EventReturn MainScreen::OnAllowStorage(UI::EventParams &e) { + return UI::EVENT_DONE; + } + +-UI::EventReturn MainScreen::OnDownloadUpgrade(UI::EventParams &e) { +-#if PPSSPP_PLATFORM(ANDROID) +- // Go to app store +- if (System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- LaunchBrowser("market://details?id=org.ppsspp.ppssppgold"); +- } else { +- LaunchBrowser("market://details?id=org.ppsspp.ppsspp"); +- } +-#else +- // Go directly to ppsspp.org and let the user sort it out +- LaunchBrowser("https://www.ppsspp.org/downloads.html"); +-#endif +- return UI::EVENT_DONE; +-} +- +-UI::EventReturn MainScreen::OnDismissUpgrade(UI::EventParams &e) { +- g_Config.DismissUpgrade(); +- upgradeBar_->SetVisibility(UI::V_GONE); +- return UI::EVENT_DONE; +-} +- + void MainScreen::sendMessage(const char *message, const char *value) { + // Always call the base class method first to handle the most common messages. + UIScreenWithBackground::sendMessage(message, value); +@@ -1319,15 +1267,6 @@ UI::EventReturn MainScreen::OnCredits(UI::EventParams &e) { + return UI::EVENT_DONE; + } + +-UI::EventReturn MainScreen::OnSupport(UI::EventParams &e) { +-#ifdef __ANDROID__ +- LaunchBrowser("market://details?id=org.ppsspp.ppssppgold"); +-#else +- LaunchBrowser("https://central.ppsspp.org/buygold"); +-#endif +- return UI::EVENT_DONE; +-} +- + UI::EventReturn MainScreen::OnPPSSPPOrg(UI::EventParams &e) { + LaunchBrowser("https://www.ppsspp.org"); + return UI::EVENT_DONE; +diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp +index a6542c65d..f5f101594 100644 +--- a/UI/MiscScreens.cpp ++++ b/UI/MiscScreens.cpp +@@ -498,11 +498,7 @@ void LogoScreen::render() { + char temp[256]; + // Manually formatting UTF-8 is fun. \xXX doesn't work everywhere. + snprintf(temp, sizeof(temp), "%s Henrik Rydg%c%crd", cr->T("created", "Created by"), 0xC3, 0xA5); +- if (System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- dc.Draw()->DrawImage(ImageID("I_ICONGOLD"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER); +- } else { +- dc.Draw()->DrawImage(ImageID("I_ICON"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER); +- } ++ dc.Draw()->DrawImage(ImageID("I_ICON"), bounds.centerX() - 120, bounds.centerY() - 30, 1.2f, textColor, ALIGN_CENTER); + dc.Draw()->DrawImage(ImageID("I_LOGO"), bounds.centerX() + 40, bounds.centerY() - 30, 1.5f, textColor, ALIGN_CENTER); + //dc.Draw()->DrawTextShadow(UBUNTU48, "PPSSPP", xres / 2, yres / 2 - 30, textColor, ALIGN_CENTER); + dc.SetFontScale(1.0f, 1.0f); +@@ -538,10 +534,6 @@ void CreditsScreen::CreateViews() { + // Really need to redo this whole layout with some linear layouts... + + int rightYOffset = 0; +- if (!System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- root_->Add(new Button(cr->T("Buy Gold"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, 84, false)))->OnClick.Handle(this, &CreditsScreen::OnSupport); +- rightYOffset = 74; +- } + root_->Add(new Button(cr->T("PPSSPP Forums"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 158, false)))->OnClick.Handle(this, &CreditsScreen::OnForums); + root_->Add(new Button(cr->T("Discord"), new AnchorLayoutParams(260, 64, 10, NONE, NONE, 232, false)))->OnClick.Handle(this, &CreditsScreen::OnDiscord); + root_->Add(new Button("www.ppsspp.org", new AnchorLayoutParams(260, 64, 10, NONE, NONE, 10, false)))->OnClick.Handle(this, &CreditsScreen::OnPPSSPPOrg); +@@ -550,20 +542,7 @@ void CreditsScreen::CreateViews() { + #if PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(IOS) + root_->Add(new Button(cr->T("Share PPSSPP"), new AnchorLayoutParams(260, 64, NONE, NONE, 10, rightYOffset + 158, false)))->OnClick.Handle(this, &CreditsScreen::OnShare); + #endif +- if (System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- root_->Add(new ImageView(ImageID("I_ICONGOLD"), IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false))); +- } else { +- root_->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false))); +- } +-} +- +-UI::EventReturn CreditsScreen::OnSupport(UI::EventParams &e) { +-#ifdef __ANDROID__ +- LaunchBrowser("market://details?id=org.ppsspp.ppssppgold"); +-#else +- LaunchBrowser("https://central.ppsspp.org/buygold"); +-#endif +- return UI::EVENT_DONE; ++ root_->Add(new ImageView(ImageID("I_ICON"), IS_DEFAULT, new AnchorLayoutParams(100, 64, 10, 10, NONE, NONE, false))); + } + + UI::EventReturn CreditsScreen::OnTwitter(UI::EventParams &e) { +@@ -747,11 +726,7 @@ void CreditsScreen::render() { + + // TODO: This is kinda ugly, done on every frame... + char temp[256]; +- if (System_GetPropertyBool(SYSPROP_APP_GOLD)) { +- snprintf(temp, sizeof(temp), "PPSSPP Gold %s", PPSSPP_GIT_VERSION); +- } else { +- snprintf(temp, sizeof(temp), "PPSSPP %s", PPSSPP_GIT_VERSION); +- } ++ snprintf(temp, sizeof(temp), "PPSSPP %s", PPSSPP_GIT_VERSION); + credits[0] = (const char *)temp; + + UIContext &dc = *screenManager()->getUIContext(); +diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp +index 24f3b964d..1d66ba7ee 100644 +--- a/UWP/PPSSPP_UWPMain.cpp ++++ b/UWP/PPSSPP_UWPMain.cpp +@@ -399,12 +399,6 @@ bool System_GetPropertyBool(SystemProperty prop) { + return false; + case SYSPROP_HAS_BACK_BUTTON: + return true; +- case SYSPROP_APP_GOLD: +-#ifdef GOLD +- return true; +-#else +- return false; +-#endif + default: + return false; + } +diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp +index b5e1bb0eb..71b29b48a 100644 +--- a/Windows/MainWindowMenu.cpp ++++ b/Windows/MainWindowMenu.cpp +@@ -1377,7 +1377,7 @@ namespace MainWindow { + { + W32Util::CenterWindow(hDlg); + HWND versionBox = GetDlgItem(hDlg, IDC_VERSION); +- std::string windowText = System_GetPropertyBool(SYSPROP_APP_GOLD) ? "PPSSPP Gold " : "PPSSPP "; ++ std::string windowText = "PPSSPP "; + windowText.append(PPSSPP_GIT_VERSION); + SetWindowText(versionBox, ConvertUTF8ToWString(windowText).c_str()); + } +diff --git a/Windows/main.cpp b/Windows/main.cpp +index 3795597e2..fd98d0453 100644 +--- a/Windows/main.cpp ++++ b/Windows/main.cpp +@@ -268,12 +268,6 @@ bool System_GetPropertyBool(SystemProperty prop) { + return true; + case SYSPROP_HAS_BACK_BUTTON: + return true; +- case SYSPROP_APP_GOLD: +-#ifdef GOLD +- return true; +-#else +- return false; +-#endif + default: + return false; + } +diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp +index 086371085..0a340c0ae 100644 +--- a/android/jni/app-android.cpp ++++ b/android/jni/app-android.cpp +@@ -372,12 +372,6 @@ bool System_GetPropertyBool(SystemProperty prop) { + return true; + case SYSPROP_HAS_IMAGE_BROWSER: + return true; +- case SYSPROP_APP_GOLD: +-#ifdef GOLD +- return true; +-#else +- return false; +-#endif + default: + return false; + } +-- +2.26.2 + -- cgit v1.2.3 From 9299da1362b0a236cc5ba2651632bf5845fe13d4 Mon Sep 17 00:00:00 2001 From: Alberto Eleuterio Flores Guerrero Date: Wed, 17 Jun 2020 11:45:17 +0200 Subject: gnu: Add widelands. * gnu/local.mk (widelands): New variable. * gnu/packages/patches/widelands-system-wide_minizip.patch: New file. (dist_patch_DATA): Register file above. Co-authored-by: Nicolas Goaziou --- gnu/local.mk | 1 + gnu/packages/games.scm | 108 +++++++++++++++ .../patches/widelands-system-wide_minizip.patch | 153 +++++++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 gnu/packages/patches/widelands-system-wide_minizip.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index dbeec8be3c..3d542024de 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1604,6 +1604,7 @@ dist_patch_DATA = \ %D%/packages/patches/wicd-get-selected-profile-fix.patch \ %D%/packages/patches/wicd-urwid-1.3.patch \ %D%/packages/patches/wicd-wpa2-ttls.patch \ + %D%/packages/patches/widelands-system-wide_minizip.patch \ %D%/packages/patches/wmctrl-64-fix.patch \ %D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \ %D%/packages/patches/wordnet-CVE-2008-2149.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 14deb47854..f7ebac6d98 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -4401,6 +4401,114 @@ tactics.") license:gpl2+ license:lgpl2.1+)))) +(define-public widelands + (package + (name "widelands") + (version "20") + (source + (origin + (method url-fetch) + (uri (string-append "https://launchpad.net/widelands/" + "build" version "/build" version "/+download/" + "widelands-build" version ".tar.bz2")) + (sha256 + (base32 "1cmwfwk7j6yi2pwmm4rm57s23sdzasqf53nx6567sdagqyc4sn9q")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "src/third_party/minizip") + #t)) + (patches + ;; Use system Minizip. Patch is provided by Debian, and discussed + ;; upstream at . + (search-patches "widelands-system-wide_minizip.patch")))) + (build-system cmake-build-system) + (arguments + `(#:configure-flags + (let* ((out (assoc-ref %outputs "out")) + (share (string-append out "/share"))) + (list (string-append "-DCMAKE_INSTALL_PREFIX=" out "/bin") + (string-append "-DWL_INSTALL_BASEDIR=" share "/widelands") + (string-append "-DWL_INSTALL_DATADIR=" share "/widelands") + "-DOPTION_BUILD_WEBSITE_TOOLS=OFF" + ;; CMakeLists.txt does not handle properly RelWithDebInfo build + ;; type. When used, no game data is installed! + "-DCMAKE_BUILD_TYPE=Release")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'install-desktop-file-and-icons + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((share (string-append (assoc-ref outputs "out") "/share")) + (applications (string-append share "/applications")) + (icons (string-append share "/icons/hicolor"))) + ;; Move desktop entry. + (mkdir-p applications) + (copy-file "debian/org.widelands.widelands.desktop" + (string-append applications "/widelands.desktop")) + ;; Install icons. + (for-each (lambda (size) + (let* ((dim (string-append size "x" size)) + (apps (string-append icons "/" dim "/apps"))) + (mkdir-p apps) + (copy-file (string-append "data/images/logos" + "/wl-ico-" size ".png") + (string-append apps "/widelands.png")))) + '("16" "32" "48" "64" "128")) + #t))) + (add-after 'unpack 'unbundle-fonts + ;; Unbundle fonts already packaged in Guix. XXX: missing fonts are + ;; amiri, Culmus, mmrCensus, Nakula, and Sinhala. + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "data/i18n/fonts" + (for-each (lambda (font) + (delete-file-recursively font) + (symlink (string-append (assoc-ref inputs font) + "/share/fonts/truetype") + font)) + '("DejaVu" "MicroHei"))) + #t))))) + (native-inputs + `(("gettext" ,gettext-minimal) + ("python" ,python-wrapper))) + (inputs + `(("boost" ,boost) + ("glew" ,glew) + ("icu4c" ,icu4c) + ("libpng" ,libpng) + ("minizip" ,minizip) + ("sdl" ,(sdl-union (list sdl2 sdl2-image sdl2-mixer sdl2-ttf))) + ("zlib" ,zlib) + ;; Fonts for the ‘unbundle-fonts’ phase. Case matters in name! + ("DejaVu" ,font-dejavu) + ("MicroHei" ,font-wqy-microhei))) + (home-page "https://www.widelands.org/") + (synopsis "Fantasy real-time strategy game") + (description + "In Widelands, you are the regent of a small clan. You start out with +nothing but your headquarters, where all your resources are stored. + +In the course of the game, you will build an ever growing settlement. Every +member of your clan will do his or her part to produce more resources---wood, +food, iron, gold and more---to further this growth. The economic network is +complex and different in the four tribes (Barbarians, Empire, Atlanteans, and +Frisians). + +As you are not alone in the world, you will meet other clans sooner or later. +Some of them may be friendly and you may eventually trade with them. However, +if you want to rule the world, you will have to train soldiers and fight. + +Widelands offers single-player mode with different campaigns; the campaigns +all tell stories of tribes and their struggle in the Widelands universe! +However, settling really starts when you unite with friends over the Internet +or LAN to build up new empires together---or to crush each other in the dusts +of war. Widelands also offers an Artificial Intelligence to challenge you.") + ;; Game is released as GPL2+. Some parts, e.g., art, are released under + ;; different licenses. + (license (list license:gpl2+ + license:expat ;src/third_party/eris + license:silofl1.1 ;Widelands.ttf + license:cc-by-sa3.0)))) ;some music files + (define-public starfighter (package (name "starfighter") diff --git a/gnu/packages/patches/widelands-system-wide_minizip.patch b/gnu/packages/patches/widelands-system-wide_minizip.patch new file mode 100644 index 0000000000..1fac0d5396 --- /dev/null +++ b/gnu/packages/patches/widelands-system-wide_minizip.patch @@ -0,0 +1,153 @@ +Description: use the system-wide minizip instead of the embeeded one if found. +Forwarded-Upstream: It was provided by upstream: http://bazaar.launchpad.net/~widelands-dev/widelands/b19-debian/revision/8147 + . + Thanks to Fòram na Gàidhlig for the patch. + +I just added this line to make its use easier: + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/Modules) + +=== modified file 'CMakeLists.txt' +--- + CMakeLists.txt | 3 +++ + Modules/FindMinizip.cmake | 37 +++++++++++++++++++++++++++++++++++++ + cmake/WlFunctions.cmake | 7 +++++++ + src/io/CMakeLists.txt | 2 +- + src/third_party/CMakeLists.txt | 20 +++++++++++--------- + src/third_party/minizip/README.txt | 4 ++++ + 6 files changed, 63 insertions(+), 10 deletions(-) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -43,6 +43,7 @@ + endif(POLICY CMP0074) + + include("${CMAKE_SOURCE_DIR}/cmake/WlFunctions.cmake") ++set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/Modules) + + option(OPTION_USE_GLBINDING "Use glbinding instead of GLEW" OFF) + option(OPTION_GLEW_STATIC "Use static GLEW Library" OFF) +@@ -105,6 +106,8 @@ + find_package(SDL2_ttf REQUIRED) + find_package(ZLIB REQUIRED) + find_package(ICU REQUIRED) ++find_package(Minizip) ++ + if(OPTION_USE_GLBINDING) + find_package(glbinding REQUIRED) + else() +--- /dev/null ++++ b/Modules/FindMinizip.cmake +@@ -0,0 +1,37 @@ ++# - Try to find Minizip ++# Once done this will define ++# ++# MINIZIP_FOUND - system has MINIZIP ++# MINIZIP_INCLUDE_DIR - the MINIZIP include directory ++# MINIZIP_LIBRARY_DIR - where the libraries are ++# MINIZIP_LIBRARY - Link these to use MINIZIP ++# ++ ++IF (MINIZIP_INCLUDE_DIR) ++ # Already in cache, be silent ++ SET(MINIZIP_FIND_QUIETLY TRUE) ++ENDIF (MINIZIP_INCLUDE_DIR) ++ ++FIND_PATH( MINIZIP_INCLUDE_DIR ++ NAMES zip.h unzip.h ioapi.h ++ PATHS /usr/local/include /usr/include ++ PATH_SUFFIXES minizip/ ) ++SET( MINIZIP_NAMES minizip MINIZIP ) ++FIND_LIBRARY( MINIZIP_LIBRARY ++ NAMES ${MINIZIP_NAMES} ++ PATHS /usr/lib /usr/local/lib ) ++ ++GET_FILENAME_COMPONENT( MINIZIP_LIBRARY_DIR ${MINIZIP_LIBRARY} PATH ) ++ ++IF (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY) ++ SET(MINIZIP_FOUND TRUE) ++ SET(MINIZIP_LIBRARY_DIR ${MINIZIP_LIBRARY} ) ++ IF (NOT MINIZIP_FIND_QUIETLY) ++ MESSAGE (STATUS "Found Minizip: ${MINIZIP_LIBRARY} ${MINIZIP_INCLUDE_DIR}") ++ ENDIF (NOT MINIZIP_FIND_QUIETLY) ++ELSE (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY) ++ SET( MINIZIP_FOUND FALSE ) ++ SET( MINIZIP_LIBRARY_DIR ) ++ SET( MINIZIP_EXTRA_DEFINITIONS ) ++ENDIF (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY) ++ +--- a/cmake/WlFunctions.cmake ++++ b/cmake/WlFunctions.cmake +@@ -81,6 +81,14 @@ + if(ARG_USES_ZLIB) + wl_include_system_directories(${NAME} ${ZLIB_INCLUDE_DIRS}) + target_link_libraries(${NAME} ${ZLIB_LIBRARY}) ++ if (MINIZIP_FOUND) ++ wl_include_system_directories(${NAME} ${MINIZIP_INCLUDE_DIR}) ++ target_link_libraries(${NAME} ${MINIZIP_LIBRARY}) ++ target_compile_definitions(${NAME} PUBLIC -DHAVE_SYSTEM_MINIZIP) ++ else(MINIZIP_FOUND) ++ target_link_libraries(${NAME} third_party_minizip) ++ message(FATAL_ERROR "You are using widelands-bundled minizip sources. Please install your distribution's minizip dev library or urge your distribution maintainer to include the minizip library in your package repository. Thank you.") ++ endif(MINIZIP_FOUND) + endif() + + # OpenGL and GLEW are one thing for us. If you use the one, you also use the +--- a/src/third_party/CMakeLists.txt ++++ b/src/third_party/CMakeLists.txt +@@ -1,12 +1,14 @@ +-wl_library(third_party_minizip +- THIRD_PARTY +- SRCS +- minizip/ioapi.h +- minizip/unzip.cc +- minizip/unzip.h +- minizip/zip.h +- USES_ZLIB +-) ++if(NOT MINIZIP_FOUND) ++ wl_library(third_party_minizip ++ THIRD_PARTY ++ SRCS ++ ioapi.h ++ unzip.cc ++ unzip.h ++ zip.h ++ USES_ZLIB ++ ) ++endif(NOT MINIZIP_FOUND) + + wl_library(third_party_eris + THIRD_PARTY +--- a/src/io/filesystem/CMakeLists.txt ++++ b/src/io/filesystem/CMakeLists.txt +@@ -12,6 +12,7 @@ + zip_exceptions.h + zip_filesystem.cc + zip_filesystem.h ++ USES_ZLIB + DEPENDS + base_exceptions + base_i18n +@@ -19,5 +20,4 @@ + base_macros + graphic_text_layout + io_stream +- third_party_minizip + ) +--- a/src/io/filesystem/zip_filesystem.h ++++ b/src/io/filesystem/zip_filesystem.h +@@ -28,8 +28,14 @@ + #include "io/filesystem/filesystem.h" + #include "io/streamread.h" + #include "io/streamwrite.h" ++ ++#ifndef HAVE_SYSTEM_MINIZIP + #include "third_party/minizip/unzip.h" + #include "third_party/minizip/zip.h" ++#else ++#include ++#include ++#endif + + class ZipFilesystem : public FileSystem { + public: -- cgit v1.2.3 From f74e9277c186be4bd8101fa3c6924f0cb04e4c13 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 30 Jun 2020 19:12:18 -0400 Subject: gnu: icecat: Update to 68.10.0-guix0-preview1 [security-fixes]. Includes fixes for CVE-2020-12417, CVE-2020-12418, CVE-2020-12419, CVE-2020-12420, and CVE-2020-12421. * gnu/packages/gnuzilla.scm (%icecat-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. Remove code that deleted the Onion Browser Button extension, which is no longer bundled upstream. * gnu/packages/patches/icecat-makeicecat.patch: Adapt to new version. --- gnu/packages/gnuzilla.scm | 18 ++++++------------ gnu/packages/patches/icecat-makeicecat.patch | 4 ++-- 2 files changed, 8 insertions(+), 14 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 3bffe12577..cc3acd6b9b 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -556,8 +556,8 @@ from forcing GEXP-PROMISE." #:system system #:guile-for-build guile))) -(define %icecat-version "68.9.0-guix0-preview1") -(define %icecat-build-id "20200602000000") ;must be of the form YYYYMMDDhhmmss +(define %icecat-version "68.10.0-guix0-preview1") +(define %icecat-build-id "20200630000000") ;must be of the form YYYYMMDDhhmmss ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat' @@ -579,11 +579,11 @@ from forcing GEXP-PROMISE." "firefox-" upstream-firefox-version ".source.tar.xz")) (sha256 (base32 - "01s41p985g6v544lf08zch3myssn5c76jwmkzzd68zd9m3hhalck")))) + "0azdinwqjfv2q37gqpxmfvzsk86pvsi6cjaq1310zs26gric5j1f")))) - (upstream-icecat-base-version "68.9.0") ; maybe older than base-version + (upstream-icecat-base-version "68.10.0") ; maybe older than base-version ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version)) - (gnuzilla-commit "d7acf32ad905a3382cb2353577a96d29aa58f589") + (gnuzilla-commit "76dced64ce0e72fe3030dc2f7b22cda8e36b165e") (gnuzilla-source (origin (method git-fetch) @@ -595,7 +595,7 @@ from forcing GEXP-PROMISE." (string-take gnuzilla-commit 8))) (sha256 (base32 - "0m49zm05m3n95diij2zyvpm74q66zxjhv9rp8zvaab0h7v2s09n9")))) + "0xcg6h0da63qyv7h575xjrbkzqqcjhwjd45x9h9qmpxiaibi9g3d")))) (makeicecat-patch (local-file (search-patch "icecat-makeicecat.patch"))) @@ -648,12 +648,6 @@ from forcing GEXP-PROMISE." "-p1" "--input" #+makeicecat-patch) (invoke "patch" "--force" "--no-backup-if-mismatch" "-p1" "--input" #+gnuzilla-fixes-patch) - - ;; Remove the bundled tortm-browser-button extension, - ;; which doesn't seem to be working properly. - (delete-file-recursively - "data/extensions/tortm-browser-button@jeremybenthum") - (patch-shebang "makeicecat") (substitute* "makeicecat" (("^FFMAJOR=(.*)" all ffmajor) diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch index d3d95cbf28..cff0b7ad45 100644 --- a/gnu/packages/patches/icecat-makeicecat.patch +++ b/gnu/packages/patches/icecat-makeicecat.patch @@ -25,7 +25,7 @@ index 8be2362..48716f2 100755 -wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc -gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 -gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc --echo -n 935105e1a8a97d64daffb372690e2b566b5f07641f01470929dbbc82d20d4407 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +-echo -n 2ec8c2627e46e80fc208584966a2ded7a0a9ff76b55ffccec0623b89b98ded2b firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - - -echo Extracting Firefox tarball -tar -xf firefox-${FFVERSION}esr.source.tar.xz @@ -37,7 +37,7 @@ index 8be2362..48716f2 100755 +# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc +# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 +# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc -+# echo -n 935105e1a8a97d64daffb372690e2b566b5f07641f01470929dbbc82d20d4407 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - ++# echo -n 2ec8c2627e46e80fc208584966a2ded7a0a9ff76b55ffccec0623b89b98ded2b firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +# +# echo Extracting Firefox tarball +# tar -xf firefox-${FFVERSION}esr.source.tar.xz -- cgit v1.2.3 From af74c0633aa62d7d4e341920cfa3265f27f793cf Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 2 Jul 2020 23:27:04 +0200 Subject: gnu: gash, gash-utils: Build with Guile 3.0. * gnu/packages/shells.scm (gash)[source]: Add 'modules' and 'snippet'. [inputs]: Change GUILE-2.2 to GUILE-3.0. (gash-utils)[source]: Add 'modules' and 'snippet'. [inputs]: Change GUILE-2.2 to GUILE-3.0. * gnu/packages/commencement.scm (gash-utils-boot)[source]: Remove unneeded 'modules' field, and add 'snippet'. (gash-utils-boot)[source]: New field. * gnu/packages/patches/gash-utils-ls-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/commencement.scm | 6 +++++- gnu/packages/patches/gash-utils-ls-test.patch | 25 +++++++++++++++++++++++++ gnu/packages/shells.scm | 24 ++++++++++++++++++++---- 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/gash-utils-ls-test.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index deece17539..040882192f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -943,6 +943,7 @@ dist_patch_DATA = \ %D%/packages/patches/fontconfig-hurd-path-max.patch \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ + %D%/packages/patches/gash-utils-ls-test.patch \ %D%/packages/patches/gawk-shell.patch \ %D%/packages/patches/gcc-arm-bug-71399.patch \ %D%/packages/patches/gcc-arm-link-spec-fix.patch \ diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index ef250e037b..d0393ebe25 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -140,7 +140,7 @@ pure Scheme to Tar and decompression in one easy step.") (name "gash-boot") (source (origin (inherit (package-source gash)) - (modules '()))) + (snippet #f))) ;discard snippet for Guile 3.0 support (arguments `(#:implicit-inputs? #f #:tests? #f @@ -170,6 +170,10 @@ pure Scheme to Tar and decompression in one easy step.") (package (inherit gash-utils) (name "gash-utils-boot") + (source (origin + (inherit (package-source gash-utils)) + (patches '()) + (snippet #f))) ;discard snippet for Guile 3.0 support (arguments `(#:implicit-inputs? #f #:tests? #f diff --git a/gnu/packages/patches/gash-utils-ls-test.patch b/gnu/packages/patches/gash-utils-ls-test.patch new file mode 100644 index 0000000000..e1dfb9c23b --- /dev/null +++ b/gnu/packages/patches/gash-utils-ls-test.patch @@ -0,0 +1,25 @@ +'ls.scm' monkey-patches (ice-9 getopt-long) to allow it to recognize '-1' +as a valid option. Unfortunately, monkey patching no longer works with +Guile 3.0 due to inlining, so change the test to make do without '-1'. + +diff --git a/tests/core-utils.org b/tests/core-utils.org +index d35ede8..22718e3 100644 +--- a/tests/core-utils.org ++++ b/tests/core-utils.org +@@ -93,14 +93,11 @@ + * ls + :script: + #+begin_src sh +- ls -1 tests/data/star ++ ls tests/data/star + #+end_src + :stdout: + #+begin_example +- 0 +- 1 +- 2 +- 3 ++ 0 1 2 3 + #+end_example + + * test-file diff --git a/gnu/packages/shells.scm b/gnu/packages/shells.scm index 109baacc30..b790a0cc18 100644 --- a/gnu/packages/shells.scm +++ b/gnu/packages/shells.scm @@ -856,12 +856,19 @@ scripts.") (sha256 (base32 "13m0yz5h9nj3x40mr6wr5xcpq1lscndfwcicw3skrz801025hhgf")) - (modules '((guix build utils))))) + (modules '((guix build utils))) + (snippet + '(begin + ;; Allow builds with Guile 3.0. + (substitute* "configure" + (("search=\"2\\.2 2\\.0\"") + "search=\"3.0 2.2 2.0\"")) + #t)))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) (inputs - `(("guile" ,guile-2.2))) + `(("guile" ,guile-3.0))) (arguments '(#:make-flags '("XFAIL_TESTS=tests/redirects.org"))) (home-page "https://savannah.nongnu.org/projects/gash/") @@ -882,12 +889,21 @@ as part of the Guix bootstrap process.") version ".tar.gz")) (sha256 (base32 - "0ib2p52qmbac5n0s5bys4fiwim461ps546976l1n7pwbs0avh7fk")))) + "0ib2p52qmbac5n0s5bys4fiwim461ps546976l1n7pwbs0avh7fk")) + (patches (search-patches "gash-utils-ls-test.patch")) + (modules '((guix build utils))) + (snippet + '(begin + ;; Allow builds with Guile 3.0. + (substitute* "configure" + (("search=\"2\\.2 2\\.0\"") + "search=\"3.0 2.2 2.0\"")) + #t)))) (build-system gnu-build-system) (native-inputs `(("pkg-config" ,pkg-config))) (inputs - `(("guile" ,guile-2.2) + `(("guile" ,guile-3.0) ("gash" ,gash))) (home-page "https://savannah.nongnu.org/projects/gash/") (synopsis "Core POSIX utilities written in Guile Scheme") -- cgit v1.2.3 From 851a7caf1a1a145a815aa11bf29aeaceca94e8c1 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 7 Jun 2020 23:25:40 +0200 Subject: gnu: llvm-9: Backport patches to fix miscompilations. * gnu/packages/llvm.scm (llvm-9)[source]: Add new patches. * gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch, gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch: New files. * gnu/local.mk (dist_patch_DATA): Register new patches. --- gnu/local.mk | 2 + gnu/packages/llvm.scm | 7 +- .../patches/llvm-9-fix-lpad-miscompilation.patch | 97 ++++++++++++++++++ .../patches/llvm-9-fix-scev-miscompilation.patch | 113 +++++++++++++++++++++ 4 files changed, 218 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch create mode 100644 gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 040882192f..47180eea9d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1242,6 +1242,8 @@ dist_patch_DATA = \ %D%/packages/patches/lirc-localstatedir.patch \ %D%/packages/patches/lirc-reproducible-build.patch \ %D%/packages/patches/llvm-3.5-fix-clang-build-with-gcc5.patch \ + %D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch \ + %D%/packages/patches/llvm-9-fix-scev-miscompilation.patch \ %D%/packages/patches/lm-sensors-hwmon-attrs.patch \ %D%/packages/patches/lrcalc-includes.patch \ %D%/packages/patches/lrzip-CVE-2017-8842.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 11e4cfbe4c..7723ff5bc1 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2019 Mathieu Othacehe ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Giacomo Leidi +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -510,7 +511,11 @@ output), and Binutils.") (uri (llvm-download-uri "llvm" version)) (sha256 (base32 - "16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880")))))) + "16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880")) + (patch-flags '("-p2")) + (patches (search-patches + "llvm-9-fix-scev-miscompilation.patch" + "llvm-9-fix-lpad-miscompilation.patch")))))) (define-public clang-runtime-9 (clang-runtime-from-llvm diff --git a/gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch b/gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch new file mode 100644 index 0000000000..6cfe07e50a --- /dev/null +++ b/gnu/packages/patches/llvm-9-fix-lpad-miscompilation.patch @@ -0,0 +1,97 @@ +From 011fb5bf8b31316472fccb1a19c91912246df9b2 Mon Sep 17 00:00:00 2001 +From: Reid Kleckner +Date: Sat, 28 Mar 2020 11:03:14 -0700 +Subject: [PATCH] [CodeGen] Fix sinking local values in lpads with phis + +There was already a test case for landingpads to handle this case, but I +had forgotten to consider PHI instructions preceding the EH_LABEL in the +landingpad. + +PR45261 +--- + llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 17 +++++++++- + llvm/test/CodeGen/X86/sink-local-value.ll | 36 ++++++++++++++++++++++ + 2 files changed, 52 insertions(+), 1 deletion(-) + +diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +index 5ac3606dc662..2638b1e8a05c 100644 +--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp ++++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +@@ -225,6 +225,21 @@ static bool isRegUsedByPhiNodes(unsigned DefReg, + return false; + } + ++static bool isTerminatingEHLabel(MachineBasicBlock *MBB, MachineInstr &MI) { ++ // Ignore non-EH labels. ++ if (!MI.isEHLabel()) ++ return false; ++ ++ // Any EH label outside a landing pad must be for an invoke. Consider it a ++ // terminator. ++ if (!MBB->isEHPad()) ++ return true; ++ ++ // If this is a landingpad, the first non-phi instruction will be an EH_LABEL. ++ // Don't consider that label to be a terminator. ++ return MI.getIterator() != MBB->getFirstNonPHI(); ++} ++ + /// Build a map of instruction orders. Return the first terminator and its + /// order. Consider EH_LABEL instructions to be terminators as well, since local + /// values for phis after invokes must be materialized before the call. +@@ -233,7 +248,7 @@ void FastISel::InstOrderMap::initialize( + unsigned Order = 0; + for (MachineInstr &I : *MBB) { + if (!FirstTerminator && +- (I.isTerminator() || (I.isEHLabel() && &I != &MBB->front()))) { ++ (I.isTerminator() || isTerminatingEHLabel(MBB, I))) { + FirstTerminator = &I; + FirstTerminatorOrder = Order; + } +diff --git a/llvm/test/CodeGen/X86/sink-local-value.ll b/llvm/test/CodeGen/X86/sink-local-value.ll +index b0e511ac1189..f7d861ac9b6c 100644 +--- a/llvm/test/CodeGen/X86/sink-local-value.ll ++++ b/llvm/test/CodeGen/X86/sink-local-value.ll +@@ -145,6 +145,42 @@ try.cont: ; preds = %entry, %lpad + ; CHECK: retl + + ++define i32 @lpad_phi() personality i32 (...)* @__gxx_personality_v0 { ++entry: ++ store i32 42, i32* @sink_across ++ invoke void @may_throw() ++ to label %try.cont unwind label %lpad ++ ++lpad: ; preds = %entry ++ %p = phi i32 [ 11, %entry ] ; Trivial, but -O0 keeps it ++ %0 = landingpad { i8*, i32 } ++ catch i8* null ++ store i32 %p, i32* @sink_across ++ br label %try.cont ++ ++try.cont: ; preds = %entry, %lpad ++ %r.0 = phi i32 [ 13, %entry ], [ 55, %lpad ] ++ ret i32 %r.0 ++} ++ ++; The constant materialization should be *after* the stores to sink_across, but ++; before any EH_LABEL. ++ ++; CHECK-LABEL: lpad_phi: ++; CHECK: movl $42, sink_across ++; CHECK: movl $13, %{{[a-z]*}} ++; CHECK: .Ltmp{{.*}}: ++; CHECK: calll may_throw ++; CHECK: .Ltmp{{.*}}: ++; CHECK: jmp .LBB{{.*}} ++; CHECK: .LBB{{.*}}: # %lpad ++; CHECK-NEXT: .Ltmp{{.*}}: ++; CHECK: movl {{.*}}, sink_across ++; CHECK: movl $55, %{{[a-z]*}} ++; CHECK: .LBB{{.*}}: # %try.cont ++; CHECK: retl ++ ++ + ; Function Attrs: nounwind readnone speculatable + declare void @llvm.dbg.value(metadata, metadata, metadata) #0 + diff --git a/gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch b/gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch new file mode 100644 index 0000000000..3f16de5a2b --- /dev/null +++ b/gnu/packages/patches/llvm-9-fix-scev-miscompilation.patch @@ -0,0 +1,113 @@ +Guix note: this got detected with the test suite of rustc 1.41.1, but +the issue potentially affects all consumers of LLVM. + +From 58e8c793d0e43150a6452e971a32d7407a8a7401 Mon Sep 17 00:00:00 2001 +From: Tim Northover +Date: Mon, 30 Sep 2019 07:46:52 +0000 +Subject: [PATCH] Revert "[SCEV] add no wrap flag for SCEVAddExpr." + +This reverts r366419 because the analysis performed is within the context of +the loop and it's only valid to add wrapping flags to "global" expressions if +they're always correct. + +llvm-svn: 373184 +--- + llvm/lib/Analysis/ScalarEvolution.cpp | 2 +- + llvm/test/Analysis/ScalarEvolution/limit-depth.ll | 2 +- + llvm/test/Analysis/ScalarEvolution/nsw.ll | 2 +- + llvm/test/Analysis/ScalarEvolution/trip-count12.ll | 2 +- + llvm/test/Analysis/ScalarEvolution/trip-count9.ll | 8 ++++---- + 5 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp +index 354ae05bb841..c29fc5dbccfb 100644 +--- a/llvm/lib/Analysis/ScalarEvolution.cpp ++++ b/llvm/lib/Analysis/ScalarEvolution.cpp +@@ -4992,7 +4992,7 @@ const SCEV *ScalarEvolution::createSimpleAffineAddRec(PHINode *PN, + // overflow. + if (auto *BEInst = dyn_cast(BEValueV)) + if (isLoopInvariant(Accum, L) && isAddRecNeverPoison(BEInst, L)) +- (void)getAddRecExpr(getAddExpr(StartVal, Accum, Flags), Accum, L, Flags); ++ (void)getAddRecExpr(getAddExpr(StartVal, Accum), Accum, L, Flags); + + return PHISCEV; + } +diff --git a/llvm/test/Analysis/ScalarEvolution/limit-depth.ll b/llvm/test/Analysis/ScalarEvolution/limit-depth.ll +index db68a4f84c91..6fdf8c5df974 100644 +--- a/llvm/test/Analysis/ScalarEvolution/limit-depth.ll ++++ b/llvm/test/Analysis/ScalarEvolution/limit-depth.ll +@@ -46,7 +46,7 @@ define void @test_mul(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f) { + define void @test_sext(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f) { + ; CHECK-LABEL: @test_sext + ; CHECK: %se2 = sext i64 %iv2.inc to i128 +-; CHECK-NEXT: --> {(1 + (sext i64 {(sext i32 (1 + %a) to i64),+,1}<%loop> to i128)),+,1}<%loop2> ++; CHECK-NEXT: --> {(1 + (sext i64 {(sext i32 (1 + %a) to i64),+,1}<%loop> to i128)),+,1}<%loop2> + entry: + br label %loop + +diff --git a/llvm/test/Analysis/ScalarEvolution/nsw.ll b/llvm/test/Analysis/ScalarEvolution/nsw.ll +index 69427368625d..ca24f9d4a04b 100644 +--- a/llvm/test/Analysis/ScalarEvolution/nsw.ll ++++ b/llvm/test/Analysis/ScalarEvolution/nsw.ll +@@ -163,7 +163,7 @@ bb5: ; preds = %bb2 + declare void @f(i32) + + ; CHECK-LABEL: nswnowrap +-; CHECK: --> {(1 + %v),+,1}<%for.body>{{ U: [^ ]+ S: [^ ]+}}{{ *}}Exits: (2 + %v) ++; CHECK: --> {(1 + %v),+,1}<%for.body>{{ U: [^ ]+ S: [^ ]+}}{{ *}}Exits: (1 + ((1 + %v) smax %v)) + define void @nswnowrap(i32 %v, i32* %buf) { + entry: + %add = add nsw i32 %v, 1 +diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count12.ll b/llvm/test/Analysis/ScalarEvolution/trip-count12.ll +index 5e7d72d5e4f3..d0086ee2e6ac 100644 +--- a/llvm/test/Analysis/ScalarEvolution/trip-count12.ll ++++ b/llvm/test/Analysis/ScalarEvolution/trip-count12.ll +@@ -1,7 +1,7 @@ + ; RUN: opt < %s -analyze -scalar-evolution | FileCheck %s + + ; CHECK: Determining loop execution counts for: @test +-; CHECK: Loop %for.body: backedge-taken count is ((-2 + %len) /u 2) ++; CHECK: Loop %for.body: backedge-taken count is ((-2 + %len) /u 2) + ; CHECK: Loop %for.body: max backedge-taken count is 1073741823 + + define zeroext i16 @test(i16* nocapture %p, i32 %len) nounwind readonly { +diff --git a/llvm/test/Analysis/ScalarEvolution/trip-count9.ll b/llvm/test/Analysis/ScalarEvolution/trip-count9.ll +index c0a1d12fa00e..9a080b34743f 100644 +--- a/llvm/test/Analysis/ScalarEvolution/trip-count9.ll ++++ b/llvm/test/Analysis/ScalarEvolution/trip-count9.ll +@@ -179,7 +179,7 @@ exit: + } + + ; CHECK: Determining loop execution counts for: @nsw_startx +-; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n)) ++; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax %n)) + ; CHECK: Loop %loop: max backedge-taken count is -1 + define void @nsw_startx(i4 %n, i4 %x) { + entry: +@@ -195,7 +195,7 @@ exit: + } + + ; CHECK: Determining loop execution counts for: @nsw_startx_step2 +-; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax %n)) /u 2) ++; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax %n)) /u 2) + ; CHECK: Loop %loop: max backedge-taken count is 7 + define void @nsw_startx_step2(i4 %n, i4 %x) { + entry: +@@ -381,7 +381,7 @@ exit: + } + + ; CHECK: Determining loop execution counts for: @even_nsw_startx +-; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n))) ++; CHECK: Loop %loop: backedge-taken count is (-1 + (-1 * %x) + ((1 + %x) smax (2 * %n))) + ; CHECK: Loop %loop: max backedge-taken count is -2 + define void @even_nsw_startx(i4 %n, i4 %x) { + entry: +@@ -398,7 +398,7 @@ exit: + } + + ; CHECK: Determining loop execution counts for: @even_nsw_startx_step2 +-; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2) ++; CHECK: Loop %loop: backedge-taken count is ((-1 + (-1 * %x) + ((2 + %x) smax (2 * %n))) /u 2) + ; CHECK: Loop %loop: max backedge-taken count is 7 + define void @even_nsw_startx_step2(i4 %n, i4 %x) { + entry: -- cgit v1.2.3 From ff2f86114c0d250351661a81bb95c627141179d8 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Fri, 3 Jul 2020 01:04:49 +0200 Subject: gnu: llvm-9: Backport patch to fix miscompilation for big-endian targets. * gnu/packages/llvm.scm (llvm-9)[source]: Add new patch. * gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch: New file. * gnu/local.mk (dist_patch_DATA): Register new file. --- gnu/local.mk | 1 + gnu/packages/llvm.scm | 1 + .../llvm-9-fix-bitcast-miscompilation.patch | 192 +++++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 47180eea9d..9a691525a2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1242,6 +1242,7 @@ dist_patch_DATA = \ %D%/packages/patches/lirc-localstatedir.patch \ %D%/packages/patches/lirc-reproducible-build.patch \ %D%/packages/patches/llvm-3.5-fix-clang-build-with-gcc5.patch \ + %D%/packages/patches/llvm-9-fix-bitcast-miscompilation.patch \ %D%/packages/patches/llvm-9-fix-lpad-miscompilation.patch \ %D%/packages/patches/llvm-9-fix-scev-miscompilation.patch \ %D%/packages/patches/lm-sensors-hwmon-attrs.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 7723ff5bc1..1a8c69639e 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -514,6 +514,7 @@ output), and Binutils.") "16hwp3qa54c3a3v7h8nlw0fh5criqh0hlr1skybyk0cz70gyx880")) (patch-flags '("-p2")) (patches (search-patches + "llvm-9-fix-bitcast-miscompilation.patch" "llvm-9-fix-scev-miscompilation.patch" "llvm-9-fix-lpad-miscompilation.patch")))))) diff --git a/gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch b/gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch new file mode 100644 index 0000000000..fe381acf1b --- /dev/null +++ b/gnu/packages/patches/llvm-9-fix-bitcast-miscompilation.patch @@ -0,0 +1,192 @@ +From f8e146f3430de3a6cd904f3f3f7aa1bfaefee14c Mon Sep 17 00:00:00 2001 +From: Bjorn Pettersson +Date: Thu, 28 Nov 2019 23:18:28 +0100 +Subject: [PATCH] [InstCombine] Fix big-endian miscompile of (bitcast + (zext/trunc (bitcast))) + +Summary: +optimizeVectorResize is rewriting patterns like: + %1 = bitcast vector %src to integer + %2 = trunc/zext %1 + %dst = bitcast %2 to vector + +Since bitcasting between integer an vector types gives +different integer values depending on endianness, we need +to take endianness into account. As it happens the old +implementation only produced the correct result for little +endian targets. + +Fixes: https://bugs.llvm.org/show_bug.cgi?id=44178 + +Reviewers: spatel, lattner, lebedev.ri + +Reviewed By: spatel, lebedev.ri + +Subscribers: lebedev.ri, hiraditya, uabelho, llvm-commits + +Tags: #llvm + +Differential Revision: https://reviews.llvm.org/D70844 + +(cherry picked from commit a9d6b0e5444741d08ff1df7cf71d1559e7fefc1f) +--- + .../InstCombine/InstCombineCasts.cpp | 79 +++++++++++++------ + llvm/test/Transforms/InstCombine/cast.ll | 6 +- + 2 files changed, 60 insertions(+), 25 deletions(-) + +diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +index 2c9ba203fbf3..0af3de300e77 100644 +--- a/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp ++++ b/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +@@ -18,6 +18,7 @@ + #include "llvm/IR/DIBuilder.h" + #include "llvm/IR/PatternMatch.h" + #include "llvm/Support/KnownBits.h" ++#include + using namespace llvm; + using namespace PatternMatch; + +@@ -1820,12 +1821,24 @@ Instruction *InstCombiner::visitPtrToInt(PtrToIntInst &CI) { + } + + /// This input value (which is known to have vector type) is being zero extended +-/// or truncated to the specified vector type. ++/// or truncated to the specified vector type. Since the zext/trunc is done ++/// using an integer type, we have a (bitcast(cast(bitcast))) pattern, ++/// endianness will impact which end of the vector that is extended or ++/// truncated. ++/// ++/// A vector is always stored with index 0 at the lowest address, which ++/// corresponds to the most significant bits for a big endian stored integer and ++/// the least significant bits for little endian. A trunc/zext of an integer ++/// impacts the big end of the integer. Thus, we need to add/remove elements at ++/// the front of the vector for big endian targets, and the back of the vector ++/// for little endian targets. ++/// + /// Try to replace it with a shuffle (and vector/vector bitcast) if possible. + /// + /// The source and destination vector types may have different element types. +-static Instruction *optimizeVectorResize(Value *InVal, VectorType *DestTy, +- InstCombiner &IC) { ++static Instruction *optimizeVectorResizeWithIntegerBitCasts(Value *InVal, ++ VectorType *DestTy, ++ InstCombiner &IC) { + // We can only do this optimization if the output is a multiple of the input + // element size, or the input is a multiple of the output element size. + // Convert the input type to have the same element type as the output. +@@ -1844,31 +1857,53 @@ static Instruction *optimizeVectorResize(Value *InVal, VectorType *DestTy, + InVal = IC.Builder.CreateBitCast(InVal, SrcTy); + } + ++ bool IsBigEndian = IC.getDataLayout().isBigEndian(); ++ unsigned SrcElts = SrcTy->getNumElements(); ++ unsigned DestElts = DestTy->getNumElements(); ++ ++ assert(SrcElts != DestElts && "Element counts should be different."); ++ + // Now that the element types match, get the shuffle mask and RHS of the + // shuffle to use, which depends on whether we're increasing or decreasing the + // size of the input. +- SmallVector ShuffleMask; ++ SmallVector ShuffleMaskStorage; ++ ArrayRef ShuffleMask; + Value *V2; + +- if (SrcTy->getNumElements() > DestTy->getNumElements()) { +- // If we're shrinking the number of elements, just shuffle in the low +- // elements from the input and use undef as the second shuffle input. +- V2 = UndefValue::get(SrcTy); +- for (unsigned i = 0, e = DestTy->getNumElements(); i != e; ++i) +- ShuffleMask.push_back(i); ++ // Produce an identify shuffle mask for the src vector. ++ ShuffleMaskStorage.resize(SrcElts); ++ std::iota(ShuffleMaskStorage.begin(), ShuffleMaskStorage.end(), 0); + ++ if (SrcElts > DestElts) { ++ // If we're shrinking the number of elements (rewriting an integer ++ // truncate), just shuffle in the elements corresponding to the least ++ // significant bits from the input and use undef as the second shuffle ++ // input. ++ V2 = UndefValue::get(SrcTy); ++ // Make sure the shuffle mask selects the "least significant bits" by ++ // keeping elements from back of the src vector for big endian, and from the ++ // front for little endian. ++ ShuffleMask = ShuffleMaskStorage; ++ if (IsBigEndian) ++ ShuffleMask = ShuffleMask.take_back(DestElts); ++ else ++ ShuffleMask = ShuffleMask.take_front(DestElts); + } else { +- // If we're increasing the number of elements, shuffle in all of the +- // elements from InVal and fill the rest of the result elements with zeros +- // from a constant zero. ++ // If we're increasing the number of elements (rewriting an integer zext), ++ // shuffle in all of the elements from InVal. Fill the rest of the result ++ // elements with zeros from a constant zero. + V2 = Constant::getNullValue(SrcTy); +- unsigned SrcElts = SrcTy->getNumElements(); +- for (unsigned i = 0, e = SrcElts; i != e; ++i) +- ShuffleMask.push_back(i); +- +- // The excess elements reference the first element of the zero input. +- for (unsigned i = 0, e = DestTy->getNumElements()-SrcElts; i != e; ++i) +- ShuffleMask.push_back(SrcElts); ++ // Use first elt from V2 when indicating zero in the shuffle mask. ++ uint32_t NullElt = SrcElts; ++ // Extend with null values in the "most significant bits" by adding elements ++ // in front of the src vector for big endian, and at the back for little ++ // endian. ++ unsigned DeltaElts = DestElts - SrcElts; ++ if (IsBigEndian) ++ ShuffleMaskStorage.insert(ShuffleMaskStorage.begin(), DeltaElts, NullElt); ++ else ++ ShuffleMaskStorage.append(DeltaElts, NullElt); ++ ShuffleMask = ShuffleMaskStorage; + } + + return new ShuffleVectorInst(InVal, V2, +@@ -2359,8 +2394,8 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &CI) { + CastInst *SrcCast = cast(Src); + if (BitCastInst *BCIn = dyn_cast(SrcCast->getOperand(0))) + if (isa(BCIn->getOperand(0)->getType())) +- if (Instruction *I = optimizeVectorResize(BCIn->getOperand(0), +- cast(DestTy), *this)) ++ if (Instruction *I = optimizeVectorResizeWithIntegerBitCasts( ++ BCIn->getOperand(0), cast(DestTy), *this)) + return I; + } + +diff --git a/llvm/test/Transforms/InstCombine/cast.ll b/llvm/test/Transforms/InstCombine/cast.ll +index b6d1eda0601d..3ce8de033422 100644 +--- a/llvm/test/Transforms/InstCombine/cast.ll ++++ b/llvm/test/Transforms/InstCombine/cast.ll +@@ -824,7 +824,7 @@ define i64 @test59(i8 %A, i8 %B) { + + define <3 x i32> @test60(<4 x i32> %call4) { + ; CHECK-LABEL: @test60( +-; CHECK-NEXT: [[P10:%.*]] = shufflevector <4 x i32> [[CALL4:%.*]], <4 x i32> undef, <3 x i32> ++; CHECK-NEXT: [[P10:%.*]] = shufflevector <4 x i32> [[CALL4:%.*]], <4 x i32> undef, <3 x i32> + ; CHECK-NEXT: ret <3 x i32> [[P10]] + ; + %p11 = bitcast <4 x i32> %call4 to i128 +@@ -836,7 +836,7 @@ define <3 x i32> @test60(<4 x i32> %call4) { + + define <4 x i32> @test61(<3 x i32> %call4) { + ; CHECK-LABEL: @test61( +-; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[CALL4:%.*]], <3 x i32> , <4 x i32> ++; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[CALL4:%.*]], <3 x i32> , <4 x i32> + ; CHECK-NEXT: ret <4 x i32> [[P10]] + ; + %p11 = bitcast <3 x i32> %call4 to i96 +@@ -848,7 +848,7 @@ define <4 x i32> @test61(<3 x i32> %call4) { + define <4 x i32> @test62(<3 x float> %call4) { + ; CHECK-LABEL: @test62( + ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <3 x float> [[CALL4:%.*]] to <3 x i32> +-; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[TMP1]], <3 x i32> , <4 x i32> ++; CHECK-NEXT: [[P10:%.*]] = shufflevector <3 x i32> [[TMP1]], <3 x i32> , <4 x i32> + ; CHECK-NEXT: ret <4 x i32> [[P10]] + ; + %p11 = bitcast <3 x float> %call4 to i96 +-- +2.26.2 + -- cgit v1.2.3 From 54e70a70f2cb6336b02ed3ac4256f6b44da5c769 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 8 Jul 2020 11:18:18 +0200 Subject: gnu: grub: Fix native compilation of EFI variant on i686-linux. This fixes a regression introduce in d613991a8ebe5d4b3a7706f8f0dd52f16fc1c50a reported on IRC by Mathieu Othacehe . * gnu/packages/patches/grub-cross-system-i686.patch [GRUB_MACHINE_EFI && !__x86_64__]: Add missing .byte alternative to 64-bit instruction. --- gnu/packages/patches/grub-cross-system-i686.patch | 31 ++++++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/grub-cross-system-i686.patch b/gnu/packages/patches/grub-cross-system-i686.patch index a376cae1db..2715345d63 100644 --- a/gnu/packages/patches/grub-cross-system-i686.patch +++ b/gnu/packages/patches/grub-cross-system-i686.patch @@ -2,18 +2,20 @@ Not upstreamed. Fixes cross-build for the Hurd, from i686-linux, see . -From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001 +From 17b242e7b80108f1467037e15b605595e4823b2e Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sun, 21 Jun 2020 15:10:40 +0200 -Subject: [PATCH] grub-core: Build fixes for i386 +Subject: [PATCH v2] grub-core: Build fixes for i386 +Content-Transfer-Encoding: 8bit +Content-Type: text/plain; charset=UTF-8 * grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386. --- - grub-core/lib/i386/relocator64.S | 26 +++++++++++++++++++++++++- - 1 file changed, 25 insertions(+), 1 deletion(-) + grub-core/lib/i386/relocator64.S | 33 +++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S -index 148f38adb..45fed9444 100644 +index 148f38adb..ea39908c1 100644 --- a/grub-core/lib/i386/relocator64.S +++ b/grub-core/lib/i386/relocator64.S @@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3) @@ -41,7 +43,22 @@ index 148f38adb..45fed9444 100644 #ifdef GRUB_MACHINE_EFI jmp LOCAL(skip_efi_stack_align) -@@ -95,8 +104,15 @@ LOCAL(skip_efi_stack_align): +@@ -85,7 +94,14 @@ VARIABLE(grub_relocator64_rsp) + */ + VARIABLE(grub_relocator64_efi_start) + /* Align the stack as UEFI spec requires. */ ++#ifndef __x86_64__ ++ .byte 0x48 ++ .byte 0x83 ++ .byte 0xe4 ++ .byte 0xf0 ++#else + andq $~15, %rsp ++#endif + + LOCAL(skip_efi_stack_align): + #endif +@@ -95,8 +111,15 @@ LOCAL(skip_efi_stack_align): VARIABLE(grub_relocator64_rsi) .quad 0 @@ -58,7 +75,7 @@ index 148f38adb..45fed9444 100644 /* mov imm64, %rax */ .byte 0x48 .byte 0xb8 -@@ -128,6 +144,14 @@ VARIABLE(grub_relocator64_rdx) +@@ -128,6 +151,14 @@ VARIABLE(grub_relocator64_rdx) #ifdef __APPLE__ .byte 0xff, 0x25 .quad 0 -- cgit v1.2.3 From bce3c9748b4ba47cdb915492e5c7baaf3d3a2511 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Thu, 9 Jul 2020 16:07:30 -0700 Subject: gnu: u-boot: Update to 2020.07. * gnu/packages/bootloaders (u-boot): Update to 2020.07. (u-boot-pinebook-pro-rk3399): Remove patches. * gnu/packages/patches: u-boot-DT-for-Pinebook-Pro.patch, u-boot-add-boe-nv140fhmn49-display.patch, u-boot-gpio-keys-binding-cons.patch, u-boot-leds-common-binding-con.patch, u-boot-support-Pinebook-Pro-laptop.patch, u-boot-video-rockchip-fix-build.patch: Remove patches. u-boot-riscv64-fix-extlinux.patch: Refresh patch. * gnu/local.mk (dist_patch_DATA): Update accordingly. --- gnu/local.mk | 6 - gnu/packages/bootloaders.scm | 13 +- .../patches/u-boot-DT-for-Pinebook-Pro.patch | 1132 -------------------- .../u-boot-add-boe-nv140fhmn49-display.patch | 29 - .../patches/u-boot-gpio-keys-binding-cons.patch | 37 - .../patches/u-boot-leds-common-binding-con.patch | 115 -- .../patches/u-boot-riscv64-fix-extlinux.patch | 14 - .../u-boot-support-Pinebook-Pro-laptop.patch | 367 ------- .../patches/u-boot-video-rockchip-fix-build.patch | 48 - 9 files changed, 2 insertions(+), 1759 deletions(-) delete mode 100644 gnu/packages/patches/u-boot-DT-for-Pinebook-Pro.patch delete mode 100644 gnu/packages/patches/u-boot-add-boe-nv140fhmn49-display.patch delete mode 100644 gnu/packages/patches/u-boot-gpio-keys-binding-cons.patch delete mode 100644 gnu/packages/patches/u-boot-leds-common-binding-con.patch delete mode 100644 gnu/packages/patches/u-boot-support-Pinebook-Pro-laptop.patch delete mode 100644 gnu/packages/patches/u-boot-video-rockchip-fix-build.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index a277e63fa4..cecc8bc4b1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1568,12 +1568,6 @@ dist_patch_DATA = \ %D%/packages/patches/tuxpaint-stamps-path.patch \ %D%/packages/patches/twinkle-bcg729.patch \ %D%/packages/patches/u-boot-riscv64-fix-extlinux.patch \ - %D%/packages/patches/u-boot-DT-for-Pinebook-Pro.patch \ - %D%/packages/patches/u-boot-add-boe-nv140fhmn49-display.patch \ - %D%/packages/patches/u-boot-gpio-keys-binding-cons.patch \ - %D%/packages/patches/u-boot-leds-common-binding-con.patch \ - %D%/packages/patches/u-boot-support-Pinebook-Pro-laptop.patch \ - %D%/packages/patches/u-boot-video-rockchip-fix-build.patch \ %D%/packages/patches/ucx-tcp-iface-ioctl.patch \ %D%/packages/patches/udiskie-no-appindicator.patch \ %D%/packages/patches/ungoogled-chromium-system-jsoncpp.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 07b406b42a..769238203c 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -446,7 +446,7 @@ tree binary files. These are board description files used by Linux and BSD.") (define u-boot (package (name "u-boot") - (version "2020.04") + (version "2020.07") (source (origin (method url-fetch) (uri (string-append @@ -454,7 +454,7 @@ tree binary files. These are board description files used by Linux and BSD.") "u-boot-" version ".tar.bz2")) (sha256 (base32 - "0wjkasnz87q86hx93inspdjfjsinmxi87bcvj30c773x0fpjlwzy")))) + "0sjzy262x93aaqd6z24ziaq19xjjjk5f577ivf768vmvwsgbzxf1")))) (native-inputs `(("bc" ,bc) ("bison" ,bison) @@ -885,15 +885,6 @@ to Novena upstream, does not load u-boot.img from the first partition.") (let ((base (make-u-boot-package "pinebook-pro-rk3399" "aarch64-linux-gnu"))) (package (inherit base) - (source (origin - (inherit (package-source u-boot)) - (patches - (search-patches "u-boot-add-boe-nv140fhmn49-display.patch" - "u-boot-gpio-keys-binding-cons.patch" - "u-boot-leds-common-binding-con.patch" - "u-boot-DT-for-Pinebook-Pro.patch" - "u-boot-support-Pinebook-Pro-laptop.patch" - "u-boot-video-rockchip-fix-build.patch")))) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases) diff --git a/gnu/packages/patches/u-boot-DT-for-Pinebook-Pro.patch b/gnu/packages/patches/u-boot-DT-for-Pinebook-Pro.patch deleted file mode 100644 index f88d12f1e2..0000000000 --- a/gnu/packages/patches/u-boot-DT-for-Pinebook-Pro.patch +++ /dev/null @@ -1,1132 +0,0 @@ -From b128c2e0b480ee992fabe554d19cd471efb11095 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 20 Apr 2020 20:27:35 +0100 -Origin: https://patchwork.ozlabs.org/project/uboot/patch/20200420192736.962307-5-pbrobinson@gmail.com/ -Subject: [PATCH 4/5] arm: dts: rockchip: Add initial DT for Pinebook Pro - -Sync initial support for Pinebook Pro device tree from Linux 5.7-rc1. - -Signed-off-by: Peter Robinson ---- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/rk3399-pinebook-pro.dts | 1096 ++++++++++++++++++++++++++ - 2 files changed, 1097 insertions(+) - create mode 100644 arch/arm/dts/rk3399-pinebook-pro.dts - -diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index 820ee9733a..885bf0ef58 100644 ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -125,6 +125,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ - rk3399-nanopi-m4.dtb \ - rk3399-nanopi-neo4.dtb \ - rk3399-orangepi.dtb \ -+ rk3399-pinebook-pro.dtb \ - rk3399-puma-ddr1333.dtb \ - rk3399-puma-ddr1600.dtb \ - rk3399-puma-ddr1866.dtb \ -diff --git a/arch/arm/dts/rk3399-pinebook-pro.dts b/arch/arm/dts/rk3399-pinebook-pro.dts -new file mode 100644 -index 0000000000..294d21bf45 ---- /dev/null -+++ b/arch/arm/dts/rk3399-pinebook-pro.dts -@@ -0,0 +1,1096 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. -+ * Copyright (c) 2018 Akash Gajjar -+ * Copyright (c) 2020 Tobias Schramm -+ */ -+ -+/dts-v1/; -+#include -+#include -+#include -+#include -+#include -+#include "rk3399.dtsi" -+#include "rk3399-opp.dtsi" -+ -+/ { -+ model = "Pine64 Pinebook Pro"; -+ compatible = "pine64,pinebook-pro", "rockchip,rk3399"; -+ -+ chosen { -+ stdout-path = "serial2:1500000n8"; -+ }; -+ -+ backlight: edp-backlight { -+ compatible = "pwm-backlight"; -+ power-supply = <&vcc_12v>; -+ pwms = <&pwm0 0 740740 0>; -+ }; -+ -+ edp_panel: edp-panel { -+ compatible = "boe,nv140fhmn49"; -+ backlight = <&backlight>; -+ enable-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&panel_en_gpio>; -+ power-supply = <&vcc3v3_panel>; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ panel_in_edp: endpoint@0 { -+ reg = <0>; -+ remote-endpoint = <&edp_out_panel>; -+ }; -+ }; -+ }; -+ }; -+ -+ /* -+ * Use separate nodes for gpio-keys to allow for selective deactivation -+ * of wakeup sources via sysfs without disabling the whole key -+ */ -+ gpio-key-lid { -+ compatible = "gpio-keys"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&lidbtn_gpio>; -+ -+ lid { -+ debounce-interval = <20>; -+ gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>; -+ label = "Lid"; -+ linux,code = ; -+ linux,input-type = ; -+ wakeup-event-action = ; -+ wakeup-source; -+ }; -+ }; -+ -+ gpio-key-power { -+ compatible = "gpio-keys"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwrbtn_gpio>; -+ -+ power { -+ debounce-interval = <20>; -+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; -+ label = "Power"; -+ linux,code = ; -+ wakeup-source; -+ }; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwrled_gpio &slpled_gpio>; -+ -+ green-led { -+ color = ; -+ default-state = "on"; -+ function = LED_FUNCTION_POWER; -+ gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; -+ label = "green:power"; -+ }; -+ -+ red-led { -+ color = ; -+ default-state = "off"; -+ function = LED_FUNCTION_STANDBY; -+ gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; -+ label = "red:standby"; -+ panic-indicator; -+ retain-state-suspended; -+ }; -+ }; -+ -+ /* Power sequence for SDIO WiFi module */ -+ sdio_pwrseq: sdio-pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ clocks = <&rk808 1>; -+ clock-names = "ext_clock"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&wifi_enable_h_gpio>; -+ post-power-on-delay-ms = <100>; -+ power-off-delay-us = <500000>; -+ -+ /* WL_REG_ON on module */ -+ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; -+ }; -+ -+ /* Audio components */ -+ es8316-sound { -+ compatible = "simple-audio-card"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&hp_det_gpio>; -+ simple-audio-card,name = "rockchip,es8316-codec"; -+ simple-audio-card,format = "i2s"; -+ simple-audio-card,mclk-fs = <256>; -+ -+ simple-audio-card,widgets = -+ "Microphone", "Mic Jack", -+ "Headphone", "Headphones", -+ "Speaker", "Speaker"; -+ simple-audio-card,routing = -+ "MIC1", "Mic Jack", -+ "Headphones", "HPOL", -+ "Headphones", "HPOR", -+ "Speaker Amplifier INL", "HPOL", -+ "Speaker Amplifier INR", "HPOR", -+ "Speaker", "Speaker Amplifier OUTL", -+ "Speaker", "Speaker Amplifier OUTR"; -+ -+ simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>; -+ simple-audio-card,aux-devs = <&speaker_amp>; -+ simple-audio-card,pin-switches = "Speaker"; -+ -+ simple-audio-card,cpu { -+ sound-dai = <&i2s1>; -+ }; -+ -+ simple-audio-card,codec { -+ sound-dai = <&es8316>; -+ }; -+ }; -+ -+ speaker_amp: speaker-amplifier { -+ compatible = "simple-audio-amplifier"; -+ enable-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>; -+ sound-name-prefix = "Speaker Amplifier"; -+ VCC-supply = <&pa_5v>; -+ }; -+ -+ /* Power tree */ -+ /* Root power source */ -+ vcc_sysin: vcc-sysin { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_sysin"; -+ regulator-always-on; -+ regulator-boot-on; -+ }; -+ -+ /* Regulators supplied by vcc_sysin */ -+ /* LCD backlight supply */ -+ vcc_12v: vcc-12v { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_12v"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <12000000>; -+ regulator-max-microvolt = <12000000>; -+ vin-supply = <&vcc_sysin>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ /* Main 3.3 V supply */ -+ vcc3v3_sys: wifi_bat: vcc3v3-sys { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_sys"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc_sysin>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ /* 5 V USB power supply */ -+ vcc5v0_usb: pa_5v: vcc5v0-usb-regulator { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwr_5v_gpio>; -+ regulator-name = "vcc5v0_usb"; -+ regulator-always-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc_sysin>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ /* RK3399 logic supply */ -+ vdd_log: vdd-log { -+ compatible = "pwm-regulator"; -+ pwms = <&pwm2 0 25000 1>; -+ regulator-name = "vdd_log"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <800000>; -+ regulator-max-microvolt = <1400000>; -+ vin-supply = <&vcc_sysin>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ /* Regulators supplied by vcc3v3_sys */ -+ /* 0.9 V supply, always on */ -+ vcc_0v9: vcc-0v9 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc_0v9"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <900000>; -+ vin-supply = <&vcc3v3_sys>; -+ }; -+ -+ /* S3 1.8 V supply, switched by vcc1v8_s3 */ -+ vcca1v8_s3: vcc1v8-s3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcca1v8_s3"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ vin-supply = <&vcc3v3_sys>; -+ }; -+ -+ /* micro SD card power */ -+ vcc3v0_sd: vcc3v0-sd { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc0_pwr_h_gpio>; -+ regulator-name = "vcc3v0_sd"; -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ vin-supply = <&vcc3v3_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ /* LCD panel power, called VCC3V3_S0 in schematic */ -+ vcc3v3_panel: vcc3v3-panel { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&lcdvcc_en_gpio>; -+ regulator-name = "vcc3v3_panel"; -+ regulator-always-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-enable-ramp-delay = <100000>; -+ vin-supply = <&vcc3v3_sys>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ /* M.2 adapter power, switched by vcc1v8_s3 */ -+ vcc3v3_ssd: vcc3v3-ssd { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3_ssd"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ vin-supply = <&vcc3v3_sys>; -+ }; -+ -+ /* Regulators supplied by vcc5v0_usb */ -+ /* USB 3 port power supply regulator */ -+ vcc5v0_otg: vcc5v0-otg { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_host_en_gpio>; -+ regulator-name = "vcc5v0_otg"; -+ regulator-always-on; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_usb>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ /* Regulators supplied by vcc5v0_usb */ -+ /* Type C port power supply regulator */ -+ vbus_5vout: vbus_typec: vbus-5vout { -+ compatible = "regulator-fixed"; -+ enable-active-high; -+ gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vcc5v0_typec0_en_gpio>; -+ regulator-name = "vbus_5vout"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc5v0_usb>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ /* Regulators supplied by vcc_1v8 */ -+ /* Primary 0.9 V LDO */ -+ vcca0v9_s3: vcca0v9-s3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc0v9_s3"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ vin-supply = <&vcc_1v8>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ mains_charger: dc-charger { -+ compatible = "gpio-charger"; -+ charger-type = "mains"; -+ gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>; -+ -+ /* Also triggered by USB charger */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&dc_det_gpio>; -+ }; -+}; -+ -+&cdn_dp { -+ status = "okay"; -+}; -+ -+&cpu_b0 { -+ cpu-supply = <&vdd_cpu_b>; -+}; -+ -+&cpu_b1 { -+ cpu-supply = <&vdd_cpu_b>; -+}; -+ -+&cpu_l0 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_l1 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_l2 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&cpu_l3 { -+ cpu-supply = <&vdd_cpu_l>; -+}; -+ -+&edp { -+ force-hpd; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&edp_hpd>; -+ status = "okay"; -+ -+ ports { -+ edp_out: port@1 { -+ reg = <1>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ edp_out_panel: endpoint@0 { -+ reg = <0>; -+ remote-endpoint = <&panel_in_edp>; -+ }; -+ }; -+ }; -+}; -+ -+&emmc_phy { -+ status = "okay"; -+}; -+ -+&gpu { -+ mali-supply = <&vdd_gpu>; -+ status = "okay"; -+}; -+ -+&hdmi_sound { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ clock-frequency = <400000>; -+ i2c-scl-falling-time-ns = <4>; -+ i2c-scl-rising-time-ns = <168>; -+ status = "okay"; -+ -+ rk808: pmic@1b { -+ compatible = "rockchip,rk808"; -+ reg = <0x1b>; -+ #clock-cells = <1>; -+ clock-output-names = "xin32k", "rk808-clkout2"; -+ interrupt-parent = <&gpio3>; -+ interrupts = <10 IRQ_TYPE_LEVEL_LOW>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pmic_int_l_gpio>; -+ rockchip,system-power-controller; -+ wakeup-source; -+ -+ vcc1-supply = <&vcc_sysin>; -+ vcc2-supply = <&vcc_sysin>; -+ vcc3-supply = <&vcc_sysin>; -+ vcc4-supply = <&vcc_sysin>; -+ vcc6-supply = <&vcc_sysin>; -+ vcc7-supply = <&vcc_sysin>; -+ vcc8-supply = <&vcc3v3_sys>; -+ vcc9-supply = <&vcc_sysin>; -+ vcc10-supply = <&vcc_sysin>; -+ vcc11-supply = <&vcc_sysin>; -+ vcc12-supply = <&vcc3v3_sys>; -+ vcc13-supply = <&vcc_sysin>; -+ vcc14-supply = <&vcc_sysin>; -+ -+ regulators { -+ /* rk3399 center logic supply */ -+ vdd_center: DCDC_REG1 { -+ regulator-name = "vdd_center"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_cpu_l: DCDC_REG2 { -+ regulator-name = "vdd_cpu_l"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <750000>; -+ regulator-max-microvolt = <1350000>; -+ regulator-ramp-delay = <6001>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_ddr: DCDC_REG3 { -+ regulator-name = "vcc_ddr"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ }; -+ }; -+ -+ vcc_1v8: vcc_wl: DCDC_REG4 { -+ regulator-name = "vcc_1v8"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ /* not used */ -+ LDO_REG1 { -+ }; -+ -+ /* not used */ -+ LDO_REG2 { -+ }; -+ -+ vcc1v8_pmupll: LDO_REG3 { -+ regulator-name = "vcc1v8_pmupll"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1800000>; -+ }; -+ }; -+ -+ vcc_sdio: LDO_REG4 { -+ regulator-name = "vcc_sdio"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3000000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3000000>; -+ }; -+ }; -+ -+ vcca3v0_codec: LDO_REG5 { -+ regulator-name = "vcca3v0_codec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_1v5: LDO_REG6 { -+ regulator-name = "vcc_1v5"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <1500000>; -+ }; -+ }; -+ -+ vcca1v8_codec: LDO_REG7 { -+ regulator-name = "vcca1v8_codec"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc_3v0: LDO_REG8 { -+ regulator-name = "vcc_3v0"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ -+ regulator-state-mem { -+ regulator-on-in-suspend; -+ regulator-suspend-microvolt = <3000000>; -+ }; -+ }; -+ -+ vcc3v3_s3: SWITCH_REG1 { -+ regulator-name = "vcc3v3_s3"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vcc3v3_s0: SWITCH_REG2 { -+ regulator-name = "vcc3v3_s0"; -+ regulator-always-on; -+ regulator-boot-on; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ }; -+ }; -+ -+ vdd_cpu_b: regulator@40 { -+ compatible = "silergy,syr827"; -+ reg = <0x40>; -+ fcs,suspend-voltage-selector = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vsel1_gpio>; -+ regulator-name = "vdd_cpu_b"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1500000>; -+ regulator-ramp-delay = <1000>; -+ vin-supply = <&vcc_1v8>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+ -+ vdd_gpu: regulator@41 { -+ compatible = "silergy,syr828"; -+ reg = <0x41>; -+ fcs,suspend-voltage-selector = <1>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vsel2_gpio>; -+ regulator-name = "vdd_gpu"; -+ regulator-always-on; -+ regulator-boot-on; -+ regulator-min-microvolt = <712500>; -+ regulator-max-microvolt = <1500000>; -+ regulator-ramp-delay = <1000>; -+ vin-supply = <&vcc_1v8>; -+ -+ regulator-state-mem { -+ regulator-off-in-suspend; -+ }; -+ }; -+}; -+ -+&i2c1 { -+ clock-frequency = <100000>; -+ i2c-scl-falling-time-ns = <4>; -+ i2c-scl-rising-time-ns = <168>; -+ status = "okay"; -+ -+ es8316: es8316@11 { -+ compatible = "everest,es8316"; -+ reg = <0x11>; -+ clocks = <&cru SCLK_I2S_8CH_OUT>; -+ clock-names = "mclk"; -+ #sound-dai-cells = <0>; -+ }; -+}; -+ -+&i2c3 { -+ i2c-scl-falling-time-ns = <15>; -+ i2c-scl-rising-time-ns = <450>; -+ status = "okay"; -+}; -+ -+&i2c4 { -+ i2c-scl-falling-time-ns = <20>; -+ i2c-scl-rising-time-ns = <600>; -+ status = "okay"; -+ -+ fusb0: fusb30x@22 { -+ compatible = "fcs,fusb302"; -+ reg = <0x22>; -+ fcs,int_n = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&fusb0_int_gpio>; -+ vbus-supply = <&vbus_typec>; -+ -+ connector { -+ compatible = "usb-c-connector"; -+ data-role = "host"; -+ label = "USB-C"; -+ op-sink-microwatt = <1000000>; -+ power-role = "dual"; -+ sink-pdos = -+ ; -+ source-pdos = -+ ; -+ try-power-role = "sink"; -+ -+ ports { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ port@0 { -+ reg = <0>; -+ -+ usbc_hs: endpoint { -+ remote-endpoint = -+ <&u2phy0_typec_hs>; -+ }; -+ }; -+ -+ port@1 { -+ reg = <1>; -+ -+ usbc_ss: endpoint { -+ remote-endpoint = -+ <&tcphy0_typec_ss>; -+ }; -+ }; -+ -+ port@2 { -+ reg = <2>; -+ -+ usbc_dp: endpoint { -+ remote-endpoint = -+ <&tcphy0_typec_dp>; -+ }; -+ }; -+ }; -+ }; -+ }; -+}; -+ -+&i2s1 { -+ #sound-dai-cells = <0>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2s_8ch_mclk_gpio>, <&i2s1_2ch_bus>; -+ rockchip,capture-channels = <8>; -+ rockchip,playback-channels = <8>; -+ status = "okay"; -+}; -+ -+&io_domains { -+ audio-supply = <&vcc_3v0>; -+ gpio1830-supply = <&vcc_3v0>; -+ sdmmc-supply = <&vcc_sdio>; -+ status = "okay"; -+}; -+ -+&pcie_phy { -+ status = "okay"; -+}; -+ -+&pcie0 { -+ bus-scan-delay-ms = <1000>; -+ ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>; -+ max-link-speed = <2>; -+ num-lanes = <4>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pcie_clkreqn_cpm>; -+ vpcie0v9-supply = <&vcca0v9_s3>; -+ vpcie1v8-supply = <&vcca1v8_s3>; -+ vpcie3v3-supply = <&vcc3v3_ssd>; -+ status = "okay"; -+}; -+ -+&pinctrl { -+ buttons { -+ pwrbtn_gpio: pwrbtn-gpio { -+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ -+ lidbtn_gpio: lidbtn-gpio { -+ rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ dc-charger { -+ dc_det_gpio: dc-det-gpio { -+ rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ es8316 { -+ hp_det_gpio: hp-det-gpio { -+ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ fusb302x { -+ fusb0_int_gpio: fusb0-int-gpio { -+ rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ i2s1 { -+ i2s_8ch_mclk_gpio: i2s-8ch-mclk-gpio { -+ rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>; -+ }; -+ }; -+ -+ lcd-panel { -+ lcdvcc_en_gpio: lcdvcc-en-gpio { -+ rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ panel_en_gpio: panel-en-gpio { -+ rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ lcd_panel_reset_gpio: lcd-panel-reset-gpio { -+ rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ leds { -+ pwrled_gpio: pwrled_gpio { -+ rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ slpled_gpio: slpled_gpio { -+ rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ pmic { -+ pmic_int_l_gpio: pmic-int-l-gpio { -+ rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ -+ vsel1_gpio: vsel1-gpio { -+ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ -+ vsel2_gpio: vsel2-gpio { -+ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; -+ }; -+ }; -+ -+ sdcard { -+ sdmmc0_pwr_h_gpio: sdmmc0-pwr-h-gpio { -+ rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ }; -+ -+ sdio-pwrseq { -+ wifi_enable_h_gpio: wifi-enable-h-gpio { -+ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ usb-typec { -+ vcc5v0_typec0_en_gpio: vcc5v0-typec0-en-gpio { -+ rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; -+ }; -+ }; -+ -+ usb2 { -+ pwr_5v_gpio: pwr-5v-gpio { -+ rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ vcc5v0_host_en_gpio: vcc5v0-host-en-gpio { -+ rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+ -+ wireless-bluetooth { -+ bt_wake_gpio: bt-wake-gpio { -+ rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ bt_host_wake_gpio: bt-host-wake-gpio { -+ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ -+ bt_reset_gpio: bt-reset-gpio { -+ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; -+ }; -+ }; -+}; -+ -+&pmu_io_domains { -+ pmu1830-supply = <&vcc_3v0>; -+ status = "okay"; -+}; -+ -+&pwm0 { -+ status = "okay"; -+}; -+ -+&pwm2 { -+ status = "okay"; -+}; -+ -+&saradc { -+ vref-supply = <&vcca1v8_s3>; -+ status = "okay"; -+}; -+ -+&sdmmc { -+ bus-width = <4>; -+ cap-mmc-highspeed; -+ cap-sd-highspeed; -+ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; -+ disable-wp; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; -+ sd-uhs-sdr104; -+ vmmc-supply = <&vcc3v0_sd>; -+ vqmmc-supply = <&vcc_sdio>; -+ status = "okay"; -+}; -+ -+&sdio0 { -+ bus-width = <4>; -+ cap-sd-highspeed; -+ cap-sdio-irq; -+ keep-power-in-suspend; -+ mmc-pwrseq = <&sdio_pwrseq>; -+ non-removable; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; -+ sd-uhs-sdr104; -+ status = "okay"; -+}; -+ -+&sdhci { -+ bus-width = <8>; -+ mmc-hs200-1_8v; -+ non-removable; -+ status = "okay"; -+}; -+ -+&spi1 { -+ max-freq = <10000000>; -+ status = "okay"; -+ -+ spiflash: flash@0 { -+ compatible = "jedec,spi-nor"; -+ reg = <0>; -+ m25p,fast-read; -+ spi-max-frequency = <10000000>; -+ }; -+}; -+ -+&tcphy0 { -+ status = "okay"; -+}; -+ -+&tcphy0_dp { -+ port { -+ tcphy0_typec_dp: endpoint { -+ remote-endpoint = <&usbc_dp>; -+ }; -+ }; -+}; -+ -+&tcphy0_usb3 { -+ port { -+ tcphy0_typec_ss: endpoint { -+ remote-endpoint = <&usbc_ss>; -+ }; -+ }; -+}; -+ -+&tcphy1 { -+ status = "okay"; -+}; -+ -+&tsadc { -+ /* tshut mode 0:CRU 1:GPIO */ -+ rockchip,hw-tshut-mode = <1>; -+ /* tshut polarity 0:LOW 1:HIGH */ -+ rockchip,hw-tshut-polarity = <1>; -+ status = "okay"; -+}; -+ -+&u2phy0 { -+ status = "okay"; -+ -+ u2phy0_otg: otg-port { -+ status = "okay"; -+ }; -+ -+ u2phy0_host: host-port { -+ phy-supply = <&vcc5v0_otg>; -+ status = "okay"; -+ }; -+ -+ port { -+ u2phy0_typec_hs: endpoint { -+ remote-endpoint = <&usbc_hs>; -+ }; -+ }; -+}; -+ -+&u2phy1 { -+ status = "okay"; -+ -+ u2phy1_otg: otg-port { -+ status = "okay"; -+ }; -+ -+ u2phy1_host: host-port { -+ phy-supply = <&vcc5v0_otg>; -+ status = "okay"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>; -+ uart-has-rtscts; -+ status = "okay"; -+ -+ bluetooth { -+ compatible = "brcm,bcm4345c5"; -+ clocks = <&rk808 1>; -+ clock-names = "lpo"; -+ device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>; -+ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; -+ max-speed = <1500000>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bt_host_wake_gpio &bt_wake_gpio &bt_reset_gpio>; -+ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; -+ vbat-supply = <&wifi_bat>; -+ vddio-supply = <&vcc_wl>; -+ }; -+}; -+ -+&uart2 { -+ status = "okay"; -+}; -+ -+&usb_host0_ehci { -+ status = "okay"; -+}; -+ -+&usb_host0_ohci { -+ status = "okay"; -+}; -+ -+&usb_host1_ehci { -+ status = "okay"; -+}; -+ -+&usb_host1_ohci { -+ status = "okay"; -+}; -+ -+&usbdrd3_0 { -+ status = "okay"; -+}; -+ -+&usbdrd_dwc3_0 { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&usbdrd3_1 { -+ status = "okay"; -+}; -+ -+&usbdrd_dwc3_1 { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&vopb { -+ status = "okay"; -+}; -+ -+&vopb_mmu { -+ status = "okay"; -+}; -+ -+&vopl { -+ status = "okay"; -+}; -+ -+&vopl_mmu { -+ status = "okay"; -+}; --- -2.20.1 - diff --git a/gnu/packages/patches/u-boot-add-boe-nv140fhmn49-display.patch b/gnu/packages/patches/u-boot-add-boe-nv140fhmn49-display.patch deleted file mode 100644 index c359522967..0000000000 --- a/gnu/packages/patches/u-boot-add-boe-nv140fhmn49-display.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 00978950fed39b6104b6b4f141450a66cc3400fa Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 20 Apr 2020 20:27:32 +0100 -Origin: https://patchwork.ozlabs.org/project/uboot/patch/20200420192736.962307-2-pbrobinson@gmail.com/ -Subject: [PATCH 1/5] video: simple_panel: add boe,nv140fhmn49 display - -add "boe,nv140fhmn49" display to compatible node. - -Signed-off-by: Peter Robinson -Cc: Anatolij Gustschin ---- - drivers/video/simple_panel.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c -index c3c0e84732..5722811117 100644 ---- a/drivers/video/simple_panel.c -+++ b/drivers/video/simple_panel.c -@@ -105,6 +105,7 @@ static const struct udevice_id simple_panel_ids[] = { - { .compatible = "auo,b133xtn01" }, - { .compatible = "auo,b116xw03" }, - { .compatible = "auo,b133htn01" }, -+ { .compatible = "boe,nv140fhmn49" }, - { .compatible = "lg,lb070wv8" }, - { } - }; --- -2.20.1 - diff --git a/gnu/packages/patches/u-boot-gpio-keys-binding-cons.patch b/gnu/packages/patches/u-boot-gpio-keys-binding-cons.patch deleted file mode 100644 index aec33a7023..0000000000 --- a/gnu/packages/patches/u-boot-gpio-keys-binding-cons.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 451bd72bf966df7518682cb748a804634ea19424 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 20 Apr 2020 20:27:33 +0100 -Origin: https://patchwork.ozlabs.org/project/uboot/patch/20200420192736.962307-3-pbrobinson@gmail.com/ -Subject: [PATCH 2/5] dt-bindings: input: adopt Linux gpio-keys binding - constants - -Sync the gpio-keys input bindings from linux 5.7-rc1. - -Signed-off-by: Peter Robinson ---- - include/dt-bindings/input/gpio-keys.h | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - create mode 100644 include/dt-bindings/input/gpio-keys.h - -diff --git a/include/dt-bindings/input/gpio-keys.h b/include/dt-bindings/input/gpio-keys.h -new file mode 100644 -index 0000000000..8962df79e7 ---- /dev/null -+++ b/include/dt-bindings/input/gpio-keys.h -@@ -0,0 +1,13 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * This header provides constants for gpio keys bindings. -+ */ -+ -+#ifndef _DT_BINDINGS_GPIO_KEYS_H -+#define _DT_BINDINGS_GPIO_KEYS_H -+ -+#define EV_ACT_ANY 0x00 /* asserted or deasserted */ -+#define EV_ACT_ASSERTED 0x01 /* asserted */ -+#define EV_ACT_DEASSERTED 0x02 /* deasserted */ -+ -+#endif /* _DT_BINDINGS_GPIO_KEYS_H */ --- -2.20.1 - diff --git a/gnu/packages/patches/u-boot-leds-common-binding-con.patch b/gnu/packages/patches/u-boot-leds-common-binding-con.patch deleted file mode 100644 index 837408120b..0000000000 --- a/gnu/packages/patches/u-boot-leds-common-binding-con.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 282b6ca04abbe1302d04caa05be5fc5afb127141 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 20 Apr 2020 20:27:34 +0100 -Origin: https://patchwork.ozlabs.org/project/uboot/patch/20200420192736.962307-4-pbrobinson@gmail.com/ -Subject: [PATCH 3/5] dt-bindings: leds: adopt Linux leds common binding - constants - -Sync the common leds bindings from linux 5.7-rc1. - -Signed-off-by: Peter Robinson ---- - include/dt-bindings/leds/common.h | 91 +++++++++++++++++++++++++++++++ - 1 file changed, 91 insertions(+) - create mode 100644 include/dt-bindings/leds/common.h - -diff --git a/include/dt-bindings/leds/common.h b/include/dt-bindings/leds/common.h -new file mode 100644 -index 0000000000..0ce7dfc00d ---- /dev/null -+++ b/include/dt-bindings/leds/common.h -@@ -0,0 +1,91 @@ -+/* SPDX-License-Identifier: GPL-2.0 */ -+/* -+ * This header provides macros for the common LEDs device tree bindings. -+ * -+ * Copyright (C) 2015, Samsung Electronics Co., Ltd. -+ * Author: Jacek Anaszewski -+ * -+ * Copyright (C) 2019 Jacek Anaszewski -+ * Copyright (C) 2020 Pavel Machek -+ */ -+ -+#ifndef __DT_BINDINGS_LEDS_H -+#define __DT_BINDINGS_LEDS_H -+ -+/* External trigger type */ -+#define LEDS_TRIG_TYPE_EDGE 0 -+#define LEDS_TRIG_TYPE_LEVEL 1 -+ -+/* Boost modes */ -+#define LEDS_BOOST_OFF 0 -+#define LEDS_BOOST_ADAPTIVE 1 -+#define LEDS_BOOST_FIXED 2 -+ -+/* Standard LED colors */ -+#define LED_COLOR_ID_WHITE 0 -+#define LED_COLOR_ID_RED 1 -+#define LED_COLOR_ID_GREEN 2 -+#define LED_COLOR_ID_BLUE 3 -+#define LED_COLOR_ID_AMBER 4 -+#define LED_COLOR_ID_VIOLET 5 -+#define LED_COLOR_ID_YELLOW 6 -+#define LED_COLOR_ID_IR 7 -+#define LED_COLOR_ID_MAX 8 -+ -+/* Standard LED functions */ -+/* Keyboard LEDs, usually it would be input4::capslock etc. */ -+/* Obsolete equivalent: "shift-key-light" */ -+#define LED_FUNCTION_CAPSLOCK "capslock" -+#define LED_FUNCTION_SCROLLLOCK "scrolllock" -+#define LED_FUNCTION_NUMLOCK "numlock" -+/* Obsolete equivalents: "tpacpi::thinklight" (IBM/Lenovo Thinkpads), -+ "lp5523:kb{1,2,3,4,5,6}" (Nokia N900) */ -+#define LED_FUNCTION_KBD_BACKLIGHT "kbd_backlight" -+ -+/* System LEDs, usually found on system body. -+ platform::mute (etc) is sometimes seen, :mute would be better */ -+#define LED_FUNCTION_POWER "power" -+#define LED_FUNCTION_DISK "disk" -+ -+/* Obsolete: "platform:*:charging" (allwinner sun50i) */ -+#define LED_FUNCTION_CHARGING "charging" -+/* Used RGB notification LEDs common on phones. -+ Obsolete equivalents: "status-led:{red,green,blue}" (Motorola Droid 4), -+ "lp5523:{r,g,b}" (Nokia N900) */ -+#define LED_FUNCTION_STATUS "status" -+ -+#define LED_FUNCTION_MICMUTE "micmute" -+#define LED_FUNCTION_MUTE "mute" -+ -+/* Miscelleaus functions. Use functions above if you can. */ -+#define LED_FUNCTION_ACTIVITY "activity" -+#define LED_FUNCTION_ALARM "alarm" -+#define LED_FUNCTION_BACKLIGHT "backlight" -+#define LED_FUNCTION_BLUETOOTH "bluetooth" -+#define LED_FUNCTION_BOOT "boot" -+#define LED_FUNCTION_CPU "cpu" -+#define LED_FUNCTION_DEBUG "debug" -+#define LED_FUNCTION_DISK_ACTIVITY "disk-activity" -+#define LED_FUNCTION_DISK_ERR "disk-err" -+#define LED_FUNCTION_DISK_READ "disk-read" -+#define LED_FUNCTION_DISK_WRITE "disk-write" -+#define LED_FUNCTION_FAULT "fault" -+#define LED_FUNCTION_FLASH "flash" -+#define LED_FUNCTION_HEARTBEAT "heartbeat" -+#define LED_FUNCTION_INDICATOR "indicator" -+#define LED_FUNCTION_LAN "lan" -+#define LED_FUNCTION_MAIL "mail" -+#define LED_FUNCTION_MTD "mtd" -+#define LED_FUNCTION_PANIC "panic" -+#define LED_FUNCTION_PROGRAMMING "programming" -+#define LED_FUNCTION_RX "rx" -+#define LED_FUNCTION_SD "sd" -+#define LED_FUNCTION_STANDBY "standby" -+#define LED_FUNCTION_TORCH "torch" -+#define LED_FUNCTION_TX "tx" -+#define LED_FUNCTION_USB "usb" -+#define LED_FUNCTION_WAN "wan" -+#define LED_FUNCTION_WLAN "wlan" -+#define LED_FUNCTION_WPS "wps" -+ -+#endif /* __DT_BINDINGS_LEDS_H */ --- -2.20.1 - diff --git a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch index 3feeb1dc5e..29dec4f5e9 100644 --- a/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch +++ b/gnu/packages/patches/u-boot-riscv64-fix-extlinux.patch @@ -16,7 +16,6 @@ Signed-off-by: David Abdurachmanov --- configs/qemu-riscv64_smode_defconfig | 2 ++ configs/sifive_fu540_defconfig | 2 ++ - include/configs/sifive-fu540.h | 4 ---- 3 files changed, 4 insertions(+), 4 deletions(-) Index: u-boot/configs/qemu-riscv64_smode_defconfig @@ -39,16 +38,3 @@ Index: u-boot/configs/sifive_fu540_defconfig CONFIG_DM_MTD=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="setenv fdt_addr ${fdtcontroladdr}; fdt addr ${fdtcontroladdr};" -Index: u-boot/include/configs/sifive-fu540.h -=================================================================== ---- u-boot.orig/include/configs/sifive-fu540.h -+++ u-boot/include/configs/sifive-fu540.h -@@ -40,8 +40,4 @@ - "ramdisk_addr_r=0x88300000\0" \ - BOOTENV - --#define CONFIG_PREBOOT \ -- "setenv fdt_addr ${fdtcontroladdr};" \ -- "fdt addr ${fdtcontroladdr};" -- - #endif /* __CONFIG_H */ diff --git a/gnu/packages/patches/u-boot-support-Pinebook-Pro-laptop.patch b/gnu/packages/patches/u-boot-support-Pinebook-Pro-laptop.patch deleted file mode 100644 index c6f91fa65a..0000000000 --- a/gnu/packages/patches/u-boot-support-Pinebook-Pro-laptop.patch +++ /dev/null @@ -1,367 +0,0 @@ -From 60381e4add64dddbd07e78248b2b0f819eb2776e Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 20 Apr 2020 20:27:36 +0100 -Origin: https://patchwork.ozlabs.org/project/uboot/patch/20200420192736.962307-6-pbrobinson@gmail.com/ -Subject: [PATCH 5/5] Add initial support for the Pinebook Pro laptop from - Pine64. - -Specification: -- Rockchip RK3399 -- 4GB Dual-Channel LPDDR4 -- eMMC socket -- mSD card slot -- 128Mbit (16Mb) SPI Flash -- AP6256 for 11AC WiFi + BT5 -- 14 inch 1920*1080 eDP MiPi display -- Camera -- USB 3.0, 2.0 ports -- Type-C port with alt-mode display (DP 1.2) and 15W charge -- DC 5V/3A -- optional PCIe slot for NVMe SSD drive - -Signed-off-by: Peter Robinson ---- - arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 43 ++++++++++ - arch/arm/mach-rockchip/rk3399/Kconfig | 8 ++ - board/pine64/pinebook-pro-rk3399/Kconfig | 15 ++++ - board/pine64/pinebook-pro-rk3399/MAINTAINERS | 8 ++ - board/pine64/pinebook-pro-rk3399/Makefile | 1 + - .../pinebook-pro-rk3399/pinebook-pro-rk3399.c | 76 +++++++++++++++++ - configs/pinebook-pro-rk3399_defconfig | 84 +++++++++++++++++++ - include/configs/pinebook-pro-rk3399.h | 29 +++++++ - 8 files changed, 264 insertions(+) - create mode 100644 arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi - create mode 100644 board/pine64/pinebook-pro-rk3399/Kconfig - create mode 100644 board/pine64/pinebook-pro-rk3399/MAINTAINERS - create mode 100644 board/pine64/pinebook-pro-rk3399/Makefile - create mode 100644 board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c - create mode 100644 configs/pinebook-pro-rk3399_defconfig - create mode 100644 include/configs/pinebook-pro-rk3399.h - -diff --git a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi -new file mode 100644 -index 0000000000..1a2e24d3ef ---- /dev/null -+++ b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi -@@ -0,0 +1,43 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * Copyright (C) 2019 Peter Robinson -+ */ -+ -+#include "rk3399-u-boot.dtsi" -+#include "rk3399-sdram-lpddr4-100.dtsi" -+ -+/ { -+ aliases { -+ spi0 = &spi1; -+ }; -+ -+ chosen { -+ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; -+ }; -+}; -+ -+&i2c0 { -+ u-boot,dm-pre-reloc; -+}; -+ -+&rk808 { -+ u-boot,dm-pre-reloc; -+}; -+ -+&sdhci { -+ max-frequency = <25000000>; -+ u-boot,dm-pre-reloc; -+}; -+ -+&sdmmc { -+ max-frequency = <20000000>; -+ u-boot,dm-pre-reloc; -+}; -+ -+&spiflash { -+ u-boot,dm-pre-reloc; -+}; -+ -+&vdd_log { -+ regulator-init-microvolt = <950000>; -+}; -diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig -index 927bb62a9f..254b9c5b4d 100644 ---- a/arch/arm/mach-rockchip/rk3399/Kconfig -+++ b/arch/arm/mach-rockchip/rk3399/Kconfig -@@ -19,6 +19,13 @@ config TARGET_EVB_RK3399 - with full function and physical connectors support like Type-C ports, - USB.0 host ports, LVDS, JTAG, MAC, SD card, HDMI, USB-to-serial... - -+config TARGET_PINEBOOK_PRO_RK3399 -+ bool "Pinebook Pro" -+ help -+ Pinebook Pro is a laptop based on the Rockchip rk3399 SoC -+ with 4Gb RAM, onboard eMMC, USB-C, a USB3 and USB2 port, -+ 1920*1080 screen and all the usual laptop features. -+ - config TARGET_PUMA_RK3399 - bool "Theobroma Systems RK3399-Q7 (Puma)" - help -@@ -144,6 +151,7 @@ endif # BOOTCOUNT_LIMIT - - source "board/firefly/roc-pc-rk3399/Kconfig" - source "board/google/gru/Kconfig" -+source "board/pine64/pinebook-pro-rk3399/Kconfig" - source "board/pine64/rockpro64_rk3399/Kconfig" - source "board/rockchip/evb_rk3399/Kconfig" - source "board/theobroma-systems/puma_rk3399/Kconfig" -diff --git a/board/pine64/pinebook-pro-rk3399/Kconfig b/board/pine64/pinebook-pro-rk3399/Kconfig -new file mode 100644 -index 0000000000..3bb7ca448e ---- /dev/null -+++ b/board/pine64/pinebook-pro-rk3399/Kconfig -@@ -0,0 +1,15 @@ -+if TARGET_PINEBOOK_PRO_RK3399 -+ -+config SYS_BOARD -+ default "pinebook-pro-rk3399" -+ -+config SYS_VENDOR -+ default "pine64" -+ -+config SYS_CONFIG_NAME -+ default "pinebook-pro-rk3399" -+ -+config BOARD_SPECIFIC_OPTIONS -+ def_bool y -+ -+endif -diff --git a/board/pine64/pinebook-pro-rk3399/MAINTAINERS b/board/pine64/pinebook-pro-rk3399/MAINTAINERS -new file mode 100644 -index 0000000000..7153eaf2e0 ---- /dev/null -+++ b/board/pine64/pinebook-pro-rk3399/MAINTAINERS -@@ -0,0 +1,8 @@ -+PINEBOOK_PRO -+M: Peter Robinson -+S: Maintained -+F: board/pine64/rk3399-pinebook-pro/ -+F: include/configs/rk3399-pinebook-pro.h -+F: arch/arm/dts/rk3399-pinebook-pro.dts -+F: arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi -+F: configs/pinebook-pro-rk3399_defconfig -diff --git a/board/pine64/pinebook-pro-rk3399/Makefile b/board/pine64/pinebook-pro-rk3399/Makefile -new file mode 100644 -index 0000000000..2f692a12a6 ---- /dev/null -+++ b/board/pine64/pinebook-pro-rk3399/Makefile -@@ -0,0 +1 @@ -+obj-y += pinebook-pro-rk3399.o -diff --git a/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c b/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c -new file mode 100644 -index 0000000000..01421cbac2 ---- /dev/null -+++ b/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c -@@ -0,0 +1,76 @@ -+/* -+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd -+ * (C) Copyright 2020 Peter Robinson -+ * -+ * SPDX-License-Identifier: GPL-2.0+ -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define GRF_IO_VSEL_BT565_SHIFT 0 -+#define PMUGRF_CON0_VSEL_SHIFT 8 -+ -+#ifndef CONFIG_SPL_BUILD -+int board_early_init_f(void) -+{ -+ struct udevice *regulator; -+ int ret; -+ -+ ret = regulator_get_by_platname("vcc5v0_usb", ®ulator); -+ if (ret) { -+ debug("%s vcc5v0_usb init fail! ret %d\n", __func__, ret); -+ goto out; -+ } -+ -+ ret = regulator_set_enable(regulator, true); -+ if (ret) -+ debug("%s vcc5v0-host-en-gpio set fail! ret %d\n", __func__, ret); -+ -+out: -+ return 0; -+} -+#endif -+ -+#ifdef CONFIG_MISC_INIT_R -+static void setup_iodomain(void) -+{ -+ struct rk3399_grf_regs *grf = -+ syscon_get_first_range(ROCKCHIP_SYSCON_GRF); -+ struct rk3399_pmugrf_regs *pmugrf = -+ syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); -+ -+ /* BT565 is in 1.8v domain */ -+ rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_BT565_SHIFT); -+ -+ /* Set GPIO1 1.8v/3.0v source select to PMU1830_VOL */ -+ rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); -+} -+ -+int misc_init_r(void) -+{ -+ const u32 cpuid_offset = 0x7; -+ const u32 cpuid_length = 0x10; -+ u8 cpuid[cpuid_length]; -+ int ret; -+ -+ setup_iodomain(); -+ -+ ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); -+ if (ret) -+ return ret; -+ -+ ret = rockchip_cpuid_set(cpuid, cpuid_length); -+ if (ret) -+ return ret; -+ -+ return ret; -+} -+#endif -diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig -new file mode 100644 -index 0000000000..0e9f0ec250 ---- /dev/null -+++ b/configs/pinebook-pro-rk3399_defconfig -@@ -0,0 +1,84 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SYS_TEXT_BASE=0x00200000 -+CONFIG_ENV_OFFSET=0x3F8000 -+CONFIG_ROCKCHIP_RK3399=y -+CONFIG_RAM_RK3399_LPDDR4=y -+CONFIG_NR_DRAM_BANKS=1 -+CONFIG_TARGET_PINEBOOK_PRO_RK3399=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART=y -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_DEBUG_UART_BASE=0xFF1A0000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SPL_SPI_SUPPORT=y -+CONFIG_SPL_SPI_FLASH_SUPPORT=y -+CONFIG_SPL_MTD_SUPPORT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" -+CONFIG_MISC_INIT_R=y -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_STACK_R=y -+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 -+CONFIG_TPL=y -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" -+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_MTDPARTS=y -+CONFIG_CMD_PMIC=y -+CONFIG_CMD_REGULATOR=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_SF=y -+CONFIG_CMD_TIME=y -+CONFIG_CMD_USB=y -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_BOOTDELAY=3 -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_MISC=y -+CONFIG_ROCKCHIP_EFUSE=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+CONFIG_ROCKCHIP_SPI=y -+CONFIG_SF_DEFAULT_SPEED=20000000 -+CONFIG_SPI_FLASH=y -+CONFIG_SPI_FLASH_GIGADEVICE=y -+CONFIG_SPI_FLASH_WINBOND=y -+CONFIG_DM_ETH=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_DM_PMIC_FAN53555=y -+CONFIG_REGULATOR_PWM=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_XHCI_DWC3=y -+# CONFIG_USB_XHCI_ROCKCHIP is not set -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_ROCKCHIP_USB2_PHY=y -+CONFIG_USB_HOST_ETHER=y -+CONFIG_USB_ETHER_ASIX=y -+CONFIG_USB_ETHER_RTL8152=y -+CONFIG_USB_KEYBOARD=y -+CONFIG_USE_TINY_PRINTF=y -+CONFIG_SPL_TINY_MEMSET=y -+CONFIG_ERRNO_STR=y -+CONFIG_DM_VIDEO=y -+CONFIG_VIDEO_BPP16=y -+CONFIG_VIDEO_BPP32=y -+CONFIG_DISPLAY=y -+CONFIG_VIDEO_ROCKCHIP=y -+CONFIG_DISPLAY_ROCKCHIP_EDP=y -diff --git a/include/configs/pinebook-pro-rk3399.h b/include/configs/pinebook-pro-rk3399.h -new file mode 100644 -index 0000000000..423d742a79 ---- /dev/null -+++ b/include/configs/pinebook-pro-rk3399.h -@@ -0,0 +1,29 @@ -+/* -+ * Copyright (C) 2016 Rockchip Electronics Co., Ltd -+ * Copyright (C) 2020 Peter Robinson -+ * -+ * SPDX-License-Identifier: GPL-2.0+ -+ */ -+ -+#ifndef __PINEBOOK_PRO_RK3399_H -+#define __PINEBOOK_PRO_RK3399_H -+ -+#define ROCKCHIP_DEVICE_SETTINGS \ -+ "stdin=serial,usbkbd\0" \ -+ "stdout=serial,vidconsole\0" \ -+ "stderr=serial,vidconsole\0" -+ -+#include -+ -+#if defined(CONFIG_ENV_IS_IN_MMC) -+#define CONFIG_SYS_MMC_ENV_DEV 0 -+#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH) -+#define CONFIG_ENV_SECT_SIZE (8 * 1024) -+#endif -+ -+#undef CONFIG_SYS_SPI_U_BOOT_OFFS -+#define CONFIG_SYS_SPI_U_BOOT_OFFS 1024 * 512 -+ -+#define SDRAM_BANK_SIZE (2UL << 30) -+ -+#endif --- -2.20.1 - diff --git a/gnu/packages/patches/u-boot-video-rockchip-fix-build.patch b/gnu/packages/patches/u-boot-video-rockchip-fix-build.patch deleted file mode 100644 index ca2be8dc22..0000000000 --- a/gnu/packages/patches/u-boot-video-rockchip-fix-build.patch +++ /dev/null @@ -1,48 +0,0 @@ -From ecc69ec25df07e1ce63d7add6b235b37673ed608 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 20 Apr 2020 19:18:25 +0100 -Origin: https://patchwork.ozlabs.org/project/uboot/patch/20200420181825.935797-1-pbrobinson@gmail.com/ -Subject: [PATCH 6/6] drivers: video: rockchip: fix building eDP and LVDS - drivers - -The rk_edp.c and rk_lvds.c files reference rk_setreg which is declared in -hardware.h so include it so the drivers build. Adjust rk_lvds.c so -includes are in alphabetical order while updating. - -Signed-off-by: Peter Robinson -Reviewed-by: Anatolij Gustschin ---- - drivers/video/rockchip/rk_edp.c | 1 + - drivers/video/rockchip/rk_lvds.c | 3 ++- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/video/rockchip/rk_edp.c b/drivers/video/rockchip/rk_edp.c -index 8703df0ec0..cf84b886e7 100644 ---- a/drivers/video/rockchip/rk_edp.c -+++ b/drivers/video/rockchip/rk_edp.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - - #define MAX_CR_LOOP 5 -diff --git a/drivers/video/rockchip/rk_lvds.c b/drivers/video/rockchip/rk_lvds.c -index cf5c0439b1..79e24baf53 100644 ---- a/drivers/video/rockchip/rk_lvds.c -+++ b/drivers/video/rockchip/rk_lvds.c -@@ -13,8 +13,9 @@ - #include - #include - #include --#include - #include -+#include -+#include - #include - #include - --- -2.20.1 - -- cgit v1.2.3 From 3f4f0770512b286523a398e3f9f3eb6441f44b17 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 10 Jul 2020 00:15:42 -0400 Subject: gnu: linux-libre: Fix regression with Atheros 9271. * gnu/packages/patches/linux-libre-fix-atheros-9271.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/linux.scm (%linux-libre-fix-atheros-9271-patch): New variable. (linux-libre-4.4-source, linux-libre-4.9-source) (linux-libre-4.14-source, linux-libre-4.19-source) (linux-libre-5.4-source, linux-libre-5.7-source): Add the patch. --- gnu/local.mk | 1 + gnu/packages/linux.scm | 19 +- .../patches/linux-libre-fix-atheros-9271.patch | 225 +++++++++++++++++++++ 3 files changed, 240 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/linux-libre-fix-atheros-9271.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index cecc8bc4b1..5c3b391960 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1238,6 +1238,7 @@ dist_patch_DATA = \ %D%/packages/patches/lierolibre-try-building-other-arch.patch \ %D%/packages/patches/linkchecker-tests-require-network.patch \ %D%/packages/patches/linphoneqt-tabbutton.patch \ + %D%/packages/patches/linux-libre-fix-atheros-9271.patch \ %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \ %D%/packages/patches/linux-pam-no-setfsuid.patch \ %D%/packages/patches/lirc-localstatedir.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index d0fe5ee57a..bd7cbf183f 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -443,6 +443,9 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." (sha256 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f")))) +(define %linux-libre-fix-atheros-9271-patch + (search-patch "linux-libre-fix-atheros-9271.patch")) + (define (source-with-patches source patches) (origin (inherit source) @@ -452,12 +455,14 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." (define-public linux-libre-5.7-source (source-with-patches linux-libre-5.7-pristine-source (list %boot-logo-patch - %linux-libre-arm-export-__sync_icache_dcache-patch))) + %linux-libre-arm-export-__sync_icache_dcache-patch + %linux-libre-fix-atheros-9271-patch))) (define-public linux-libre-5.4-source (source-with-patches linux-libre-5.4-pristine-source (list %boot-logo-patch %linux-libre-arm-export-__sync_icache_dcache-patch + %linux-libre-fix-atheros-9271-patch ;; Pinebook Pro patch from linux-next, ;; can be dropped for linux-libre 5.7 (search-patch @@ -466,19 +471,23 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." (define-public linux-libre-4.19-source (source-with-patches linux-libre-4.19-pristine-source (list %boot-logo-patch - %linux-libre-arm-export-__sync_icache_dcache-patch))) + %linux-libre-arm-export-__sync_icache_dcache-patch + %linux-libre-fix-atheros-9271-patch))) (define-public linux-libre-4.14-source (source-with-patches linux-libre-4.14-pristine-source - (list %boot-logo-patch))) + (list %boot-logo-patch + %linux-libre-fix-atheros-9271-patch))) (define-public linux-libre-4.9-source (source-with-patches linux-libre-4.9-pristine-source - (list %boot-logo-patch))) + (list %boot-logo-patch + %linux-libre-fix-atheros-9271-patch))) (define-public linux-libre-4.4-source (source-with-patches linux-libre-4.4-pristine-source - (list %boot-logo-patch))) + (list %boot-logo-patch + %linux-libre-fix-atheros-9271-patch))) ;;; diff --git a/gnu/packages/patches/linux-libre-fix-atheros-9271.patch b/gnu/packages/patches/linux-libre-fix-atheros-9271.patch new file mode 100644 index 0000000000..7527f9fdf0 --- /dev/null +++ b/gnu/packages/patches/linux-libre-fix-atheros-9271.patch @@ -0,0 +1,225 @@ +Revert the following upstream commit, which broke Atheros 9271 support. +See: + https://bugzilla.kernel.org/show_bug.cgi?id=208251 + https://bugzilla.redhat.com/show_bug.cgi?id=1848631 + + +From b5c8896bc14f54e5c4dd5a6e42879f125b8abd2d Mon Sep 17 00:00:00 2001 +From: Qiujun Huang +Date: Sat, 4 Apr 2020 12:18:38 +0800 +Subject: ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb + +commit 2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 upstream. + +In ath9k_hif_usb_rx_cb interface number is assumed to be 0. +usb_ifnum_to_if(urb->dev, 0) +But it isn't always true. + +The case reported by syzbot: +https://lore.kernel.org/linux-usb/000000000000666c9c05a1c05d12@google.com +usb 2-1: new high-speed USB device number 2 using dummy_hcd +usb 2-1: config 1 has an invalid interface number: 2 but max is 0 +usb 2-1: config 1 has no interface number 0 +usb 2-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= +1.08 +usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 +general protection fault, probably for non-canonical address +0xdffffc0000000015: 0000 [#1] SMP KASAN +KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af] +CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0 + +Call Trace +__usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 +usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 +dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 +call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 +expire_timers kernel/time/timer.c:1449 [inline] +__run_timers kernel/time/timer.c:1773 [inline] +__run_timers kernel/time/timer.c:1740 [inline] +run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 +__do_softirq+0x21e/0x950 kernel/softirq.c:292 +invoke_softirq kernel/softirq.c:373 [inline] +irq_exit+0x178/0x1a0 kernel/softirq.c:413 +exiting_irq arch/x86/include/asm/apic.h:546 [inline] +smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146 +apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 + +Reported-and-tested-by: syzbot+40d5d2e8a4680952f042@syzkaller.appspotmail.com +Signed-off-by: Qiujun Huang +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20200404041838.10426-6-hqjagain@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/ath/ath9k/hif_usb.c | 48 ++++++++++++++++++++++++-------- + drivers/net/wireless/ath/ath9k/hif_usb.h | 5 ++++ + 2 files changed, 42 insertions(+), 11 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c +index 6049d3766c64..4ed21dad6a8e 100644 +--- b/drivers/net/wireless/ath/ath9k/hif_usb.c ++++ a/drivers/net/wireless/ath/ath9k/hif_usb.c +@@ -643,9 +643,9 @@ + + static void ath9k_hif_usb_rx_cb(struct urb *urb) + { +- struct rx_buf *rx_buf = (struct rx_buf *)urb->context; +- struct hif_device_usb *hif_dev = rx_buf->hif_dev; +- struct sk_buff *skb = rx_buf->skb; ++ struct sk_buff *skb = (struct sk_buff *) urb->context; ++ struct hif_device_usb *hif_dev = ++ usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); + int ret; + + if (!skb) +@@ -685,15 +685,14 @@ + return; + free: + kfree_skb(skb); +- kfree(rx_buf); + } + + static void ath9k_hif_usb_reg_in_cb(struct urb *urb) + { +- struct rx_buf *rx_buf = (struct rx_buf *)urb->context; +- struct hif_device_usb *hif_dev = rx_buf->hif_dev; +- struct sk_buff *skb = rx_buf->skb; ++ struct sk_buff *skb = (struct sk_buff *) urb->context; + struct sk_buff *nskb; ++ struct hif_device_usb *hif_dev = ++ usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); + int ret; + + if (!skb) +@@ -751,7 +750,6 @@ + return; + free: + kfree_skb(skb); +- kfree(rx_buf); + urb->context = NULL; + } + +@@ -797,7 +795,7 @@ + init_usb_anchor(&hif_dev->mgmt_submitted); + + for (i = 0; i < MAX_TX_URB_NUM; i++) { +- tx_buf = kzalloc(sizeof(*tx_buf), GFP_KERNEL); ++ tx_buf = kzalloc(sizeof(struct tx_buf), GFP_KERNEL); + if (!tx_buf) + goto err; + +@@ -834,9 +832,8 @@ + + static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) + { +- struct rx_buf *rx_buf = NULL; ++ struct urb *urb = NULL; + struct sk_buff *skb = NULL; +- struct urb *urb = NULL; + int i, ret; + + init_usb_anchor(&hif_dev->rx_submitted); +@@ -844,12 +841,6 @@ + + for (i = 0; i < MAX_RX_URB_NUM; i++) { + +- rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); +- if (!rx_buf) { +- ret = -ENOMEM; +- goto err_rxb; +- } +- + /* Allocate URB */ + urb = usb_alloc_urb(0, GFP_KERNEL); + if (urb == NULL) { +@@ -864,14 +855,11 @@ + goto err_skb; + } + +- rx_buf->hif_dev = hif_dev; +- rx_buf->skb = skb; +- + usb_fill_bulk_urb(urb, hif_dev->udev, + usb_rcvbulkpipe(hif_dev->udev, + USB_WLAN_RX_PIPE), + skb->data, MAX_RX_BUF_SIZE, +- ath9k_hif_usb_rx_cb, rx_buf); ++ ath9k_hif_usb_rx_cb, skb); + + /* Anchor URB */ + usb_anchor_urb(urb, &hif_dev->rx_submitted); +@@ -897,8 +885,6 @@ + err_skb: + usb_free_urb(urb); + err_urb: +- kfree(rx_buf); +-err_rxb: + ath9k_hif_usb_dealloc_rx_urbs(hif_dev); + return ret; + } +@@ -910,21 +896,14 @@ + + static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) + { +- struct rx_buf *rx_buf = NULL; ++ struct urb *urb = NULL; + struct sk_buff *skb = NULL; +- struct urb *urb = NULL; + int i, ret; + + init_usb_anchor(&hif_dev->reg_in_submitted); + + for (i = 0; i < MAX_REG_IN_URB_NUM; i++) { + +- rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); +- if (!rx_buf) { +- ret = -ENOMEM; +- goto err_rxb; +- } +- + /* Allocate URB */ + urb = usb_alloc_urb(0, GFP_KERNEL); + if (urb == NULL) { +@@ -939,14 +918,11 @@ + goto err_skb; + } + +- rx_buf->hif_dev = hif_dev; +- rx_buf->skb = skb; +- + usb_fill_int_urb(urb, hif_dev->udev, + usb_rcvintpipe(hif_dev->udev, + USB_REG_IN_PIPE), + skb->data, MAX_REG_IN_BUF_SIZE, +- ath9k_hif_usb_reg_in_cb, rx_buf, 1); ++ ath9k_hif_usb_reg_in_cb, skb, 1); + + /* Anchor URB */ + usb_anchor_urb(urb, &hif_dev->reg_in_submitted); +@@ -972,8 +948,6 @@ + err_skb: + usb_free_urb(urb); + err_urb: +- kfree(rx_buf); +-err_rxb: + ath9k_hif_usb_dealloc_reg_in_urbs(hif_dev); + return ret; + } +diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h +index a94e7e1c86e9..5985aa15ca93 100644 +--- b/drivers/net/wireless/ath/ath9k/hif_usb.h ++++ a/drivers/net/wireless/ath/ath9k/hif_usb.h +@@ -86,11 +86,6 @@ + struct list_head list; + }; + +-struct rx_buf { +- struct sk_buff *skb; +- struct hif_device_usb *hif_dev; +-}; +- + #define HIF_USB_TX_STOP BIT(0) + #define HIF_USB_TX_FLUSH BIT(1) + ++- +cgit 1.2.3-1.el7 + -- cgit v1.2.3 From 16e34f7598574bd79aee646deaebfeb878ef7f6e Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Mon, 8 Jun 2020 01:51:52 +0200 Subject: gnu: flint: Update to 2.6.0. * gnu/packages/algebra.scm (flint): Update to 2.6.0. * gnu/packages/patches/flint-ldconfig.patch: Remove the patch as it got applied upstream. * gnu/local.mk (dist_patch_DATA): Deregister the removed file. --- gnu/local.mk | 1 - gnu/packages/algebra.scm | 5 ++--- gnu/packages/patches/flint-ldconfig.patch | 26 -------------------------- 3 files changed, 2 insertions(+), 30 deletions(-) delete mode 100644 gnu/packages/patches/flint-ldconfig.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 5c3b391960..d2728a7fff 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -937,7 +937,6 @@ dist_patch_DATA = \ %D%/packages/patches/findutils-localstatedir.patch \ %D%/packages/patches/findutils-test-rwlock-threads.patch \ %D%/packages/patches/flann-cmake-3.11.patch \ - %D%/packages/patches/flint-ldconfig.patch \ %D%/packages/patches/foobillard++-pkg-config.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \ diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 4fef6d2405..a804982c17 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -440,15 +440,14 @@ or text interfaces) or as a C++ library.") (define-public flint (package (name "flint") - (version "2.5.2") + (version "2.6.0") (source (origin (method url-fetch) (uri (string-append "http://flintlib.org/flint-" version ".tar.gz")) (sha256 (base32 - "11syazv1a8rrnac3wj3hnyhhflpqcmq02q8pqk2m6g2k6h0gxwfb")) - (patches (search-patches "flint-ldconfig.patch")))) + "0h08a71kn8347zsqjamqnmrxjpsnnzpmhvxb6d2xmfrcs6nyv2ch")))) (build-system gnu-build-system) (propagated-inputs `(("gmp" ,gmp) diff --git a/gnu/packages/patches/flint-ldconfig.patch b/gnu/packages/patches/flint-ldconfig.patch deleted file mode 100644 index d7c66e17ab..0000000000 --- a/gnu/packages/patches/flint-ldconfig.patch +++ /dev/null @@ -1,26 +0,0 @@ -Patch by Andreas Enge . -Remedy the absence of ldconfig and explicitly create an additional symbolic -link to the flint library, as discussed privately with upstream. - -diff -r -u flint-2.5.2.orig/configure flint-2.5.2/configure ---- flint-2.5.2.orig/configure 2015-08-13 18:16:22.000000000 +0200 -+++ flint-2.5.2/configure 2015-08-14 17:38:14.316284437 +0200 -@@ -714,6 +714,7 @@ - echo "FLINT_SHARED=$SHARED" >> Makefile - echo "FLINT_LIB=$FLINT_LIB" >> Makefile - echo "FLINT_LIBNAME=$FLINT_LIBNAME" >> Makefile -+echo "FLINT_MAJOR=$FLINT_MAJOR" >> Makefile - echo "FLINT_SOLIB=$FLINT_SOLIB" >> Makefile - echo "EXEEXT=$EXEEXT" >> Makefile - echo "PREFIX=$PREFIX" >> Makefile -diff -r -u flint-2.5.2.orig/Makefile.in flint-2.5.2/Makefile.in ---- flint-2.5.2.orig/Makefile.in 2015-08-13 18:16:22.000000000 +0200 -+++ flint-2.5.2/Makefile.in 2015-08-14 17:38:50.584774817 +0200 -@@ -118,6 +118,7 @@ - $(LDCONFIG) -n "$(CURDIR)"; \ - fi - ln -sf "$(FLINT_LIB)" "$(FLINT_LIBNAME)"; \ -+ ln -sf "$(FLINT_LIB)" "$(FLINT_LIBNAME).$(FLINT_MAJOR)"; \ - - libflint.a: $(OBJS) $(LIB_SOURCES) $(EXT_SOURCES) $(HEADERS) $(EXT_HEADERS) | build build/interfaces - $(AT)$(foreach ext, $(EXTENSIONS), $(foreach dir, $(filter-out %templates, $(patsubst $(ext)/%.h, %, $(wildcard $(ext)/*.h))), mkdir -p build/$(dir); BUILD_DIR=$(CURDIR)/build/$(dir); export BUILD_DIR; MOD_DIR=$(dir); export MOD_DIR; $(MAKE) -f $(CURDIR)/Makefile.subdirs -C $(ext)/$(dir) static || exit $$?;)) -- cgit v1.2.3 From 417eaa88dc8bac3e0e0f7f74d1782629f5eb2150 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Mon, 8 Jun 2020 13:01:16 +0200 Subject: gnu: arb: Build with flint 2.6. Backport an upstream patch to fix a compatibility issue with flint 2.6. * gnu/packages/algebra.scm (arb): Add patch. * gnu/packages/patches/arb-flint-2.6.patch: New file. * gnu/local.mk (dist_patch_DATA): Register new file. --- gnu/local.mk | 1 + gnu/packages/algebra.scm | 3 +- gnu/packages/patches/arb-flint-2.6.patch | 48 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/arb-flint-2.6.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d2728a7fff..215b75f771 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -772,6 +772,7 @@ dist_patch_DATA = \ %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \ %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \ %D%/packages/patches/apr-skip-getservbyname-test.patch \ + %D%/packages/patches/arb-flint-2.6.patch \ %D%/packages/patches/aspell-default-dict-dir.patch \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc.patch \ diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 048c31d017..9041178d21 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -504,7 +504,8 @@ fast arithmetic.") (file-name (git-file-name name version)) (sha256 (base32 - "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1")))) + "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1")) + (patches (search-patches "arb-flint-2.6.patch")))) (build-system gnu-build-system) (propagated-inputs `(("flint" ,flint))) ; flint.h is included by arf.h diff --git a/gnu/packages/patches/arb-flint-2.6.patch b/gnu/packages/patches/arb-flint-2.6.patch new file mode 100644 index 0000000000..98ff5e95b4 --- /dev/null +++ b/gnu/packages/patches/arb-flint-2.6.patch @@ -0,0 +1,48 @@ +From d3d9983231e0f034e86a1e75761627eb8213b704 Mon Sep 17 00:00:00 2001 +From: fredrik +Date: Wed, 29 Apr 2020 13:41:36 +0200 +Subject: [PATCH] handle flint incompatibilities + +--- + fmpr.h | 4 ++++ + fmpz_extras.h | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/fmpr.h b/fmpr.h +index 2204d72e..c6a8c342 100644 +--- a/fmpr.h ++++ b/fmpr.h +@@ -22,7 +22,11 @@ + #include "flint/flint.h" + #include "flint/fmpz.h" + #include "flint/fmpq.h" ++#if __FLINT_RELEASE < 20600 + #include "flint/config.h" ++#else ++#include "flint/flint-config.h" ++#endif + #include "fmpz_extras.h" + + #ifndef flint_abort +diff --git a/fmpz_extras.h b/fmpz_extras.h +index 4fd0538f..486e28c8 100644 +--- a/fmpz_extras.h ++++ b/fmpz_extras.h +@@ -43,6 +43,8 @@ fmpz_add_inline(fmpz_t z, const fmpz_t x, const fmpz_t y) + fmpz_add(z, x, y); + } + ++#if __FLINT_RELEASE < 20600 ++ + static __inline__ void + fmpz_add_si(fmpz_t z, const fmpz_t x, slong y) + { +@@ -61,6 +63,8 @@ fmpz_sub_si(fmpz_t z, const fmpz_t x, slong y) + fmpz_add_ui(z, x, -y); + } + ++#endif ++ + static __inline__ void + fmpz_add_si_inline(fmpz_t z, const fmpz_t x, slong y) + { -- cgit v1.2.3 From 781d03f135c9390d565f16558fd38e7595442745 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Tue, 16 Jun 2020 21:08:20 +0200 Subject: gnu: linbox: Fix linking of dependant packages. * gnu/packages/algebra.scm (linbox)[source]: Add a patch. [inputs]: Move fflas-ffpack to... [propagated-inputs]: ...here. * gnu/packages/patches/linbox-fix-pkgconfig.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/algebra.scm | 5 +++-- gnu/packages/patches/linbox-fix-pkgconfig.patch | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/linbox-fix-pkgconfig.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 215b75f771..1ad8249d77 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1236,6 +1236,7 @@ dist_patch_DATA = \ %D%/packages/patches/lierolibre-newer-libconfig.patch \ %D%/packages/patches/lierolibre-remove-arch-warning.patch \ %D%/packages/patches/lierolibre-try-building-other-arch.patch \ + %D%/packages/patches/linbox-fix-pkgconfig.patch \ %D%/packages/patches/linkchecker-tests-require-network.patch \ %D%/packages/patches/linphoneqt-tabbutton.patch \ %D%/packages/patches/linux-libre-fix-atheros-9271.patch \ diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 9041178d21..c9ff1b8948 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -1365,14 +1365,15 @@ algebra, such as the row echelon form.") (file-name (git-file-name name version)) (sha256 (base32 - "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571")))) + "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571")) + (patches (search-patches "linbox-fix-pkgconfig.patch")))) (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) ("libtool" ,libtool) ("pkg-config" ,pkg-config))) - (inputs + (propagated-inputs `(("fflas-ffpack" ,fflas-ffpack))) (synopsis "C++ library for linear algebra over exact rings") (description diff --git a/gnu/packages/patches/linbox-fix-pkgconfig.patch b/gnu/packages/patches/linbox-fix-pkgconfig.patch new file mode 100644 index 0000000000..c93915fb1b --- /dev/null +++ b/gnu/packages/patches/linbox-fix-pkgconfig.patch @@ -0,0 +1,23 @@ +Backported from: + +From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001 +From: Cyril Bouvier +Date: Thu, 17 Jan 2019 16:32:19 +0100 +Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in + +--- + linbox.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/linbox.pc.in b/linbox.pc.in +index 278f127e4..c6b8091eb 100644 +--- a/linbox.pc.in ++++ b/linbox.pc.in +@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library + URL: http://github.com/linbox-team/linbox + Version: @VERSION@ + Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0 +-Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@ ++Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@ + Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@ @IML_CFLAGS@ @FLINT_CFLAGS@ + \------------------------------------------------------- -- cgit v1.2.3 From 5b9822cf43f0e568fc42a0a60a7ed4d77e5e9832 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Wed, 17 Jun 2020 02:08:04 +0200 Subject: gnu: Add ECL 16.1.3 for Sage. * gnu/packages/sagemath.scm (ecl-16): New variable. * gnu/packages/patches/ecl-16-format-directive-limit.patch, gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch, gnu/packages/patches/ecl-16-libffi.patch: New files. * gnu/local.mk (dist_patch_DATA): Register the patches. --- gnu/local.mk | 3 + .../patches/ecl-16-format-directive-limit.patch | 83 ++++++++++++++++++++++ .../patches/ecl-16-ignore-stderr-write-error.patch | 17 +++++ gnu/packages/patches/ecl-16-libffi.patch | 16 +++++ gnu/packages/sagemath.scm | 23 ++++++ 5 files changed, 142 insertions(+) create mode 100644 gnu/packages/patches/ecl-16-format-directive-limit.patch create mode 100644 gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch create mode 100644 gnu/packages/patches/ecl-16-libffi.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 1ad8249d77..2fc9d7a0c7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -894,6 +894,9 @@ dist_patch_DATA = \ %D%/packages/patches/dstat-skip-devices-without-io.patch \ %D%/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch \ %D%/packages/patches/dvd+rw-tools-add-include.patch \ + %D%/packages/patches/ecl-16-format-directive-limit.patch \ + %D%/packages/patches/ecl-16-ignore-stderr-write-error.patch \ + %D%/packages/patches/ecl-16-libffi.patch \ %D%/packages/patches/eigen-stabilise-sparseqr-test.patch \ %D%/packages/patches/einstein-build.patch \ %D%/packages/patches/elfutils-tests-ptrace.patch \ diff --git a/gnu/packages/patches/ecl-16-format-directive-limit.patch b/gnu/packages/patches/ecl-16-format-directive-limit.patch new file mode 100644 index 0000000000..237db92722 --- /dev/null +++ b/gnu/packages/patches/ecl-16-format-directive-limit.patch @@ -0,0 +1,83 @@ +Patch backported by Sage. + +Fix from upstream that happens to work around +https://trac.sagemath.org/ticket/23011 +diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp +index 77ca799..53b887c 100644 +--- a/src/lsp/format.lsp ++++ b/src/lsp/format.lsp +@@ -307,11 +307,13 @@ + :start (format-directive-start struct) + :end (format-directive-end struct)))) + ++(defconstant +format-directive-limit+ (1+ (char-code #\~))) ++ + #+formatter + (defparameter *format-directive-expanders* +- (make-array char-code-limit :initial-element nil)) ++ (make-array +format-directive-limit+ :initial-element nil)) + (defparameter *format-directive-interpreters* +- (make-array char-code-limit :initial-element nil)) ++ (make-array +format-directive-limit+ :initial-element nil)) + + (defparameter *default-format-error-control-string* nil) + (defparameter *default-format-error-offset* nil) +@@ -550,24 +552,24 @@ + (write-string directive stream) + (interpret-directive-list stream (cdr directives) orig-args args)) + (#-ecl format-directive #+ecl vector ++ (multiple-value-bind ++ (new-directives new-args) ++ (let* ((code (char-code (format-directive-character directive))) ++ (function ++ (and (< code +format-directive-limit+) ++ (svref *format-directive-interpreters* code))) ++ (*default-format-error-offset* ++ (1- (format-directive-end directive)))) ++ (unless function ++ (error 'format-error ++ :complaint "Unknown format directive.")) + (multiple-value-bind + (new-directives new-args) +- (let ((function +- (svref *format-directive-interpreters* +- (char-code (format-directive-character +- directive)))) +- (*default-format-error-offset* +- (1- (format-directive-end directive)))) +- (unless function +- (error 'format-error +- :complaint "Unknown format directive.")) +- (multiple-value-bind +- (new-directives new-args) +- (funcall function stream directive +- (cdr directives) orig-args args) +- (values new-directives new-args))) +- (interpret-directive-list stream new-directives +- orig-args new-args))))) ++ (funcall function stream directive ++ (cdr directives) orig-args args) ++ (values new-directives new-args))) ++ (interpret-directive-list stream new-directives ++ orig-args new-args))))) + args)) + + +@@ -639,11 +641,12 @@ + (values `(write-string ,directive stream) + more-directives)) + (format-directive +- (let ((expander +- (aref *format-directive-expanders* +- (char-code (format-directive-character directive)))) +- (*default-format-error-offset* +- (1- (format-directive-end directive)))) ++ (let* ((code (char-code (format-directive-character directive))) ++ (expander ++ (and (< code +format-directive-limit+) ++ (svref *format-directive-expanders* code))) ++ (*default-format-error-offset* ++ (1- (format-directive-end directive)))) + (if expander + (funcall expander directive more-directives) + (error 'format-error diff --git a/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch b/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch new file mode 100644 index 0000000000..42d213c0e9 --- /dev/null +++ b/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch @@ -0,0 +1,17 @@ +Patch adapted from Sage. +diff -Naur ecl-16.1.2.orig/src/c/file.d ecl-16.1.2/src/c/file.d +--- ecl-16.1.2.orig/src/c/file.d 2016-05-11 13:10:51.867673867 +1200 ++++ ecl-16.1.2/src/c/file.d 2016-05-11 14:44:48.121907307 +1200 +@@ -3354,8 +3354,10 @@ + ecl_disable_interrupts(); + do { + out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm)); +- } while (out < n && restartable_io_error(strm, "fwrite")); +- ecl_enable_interrupts(); ++ /* Ignore write errors to stderr to avoid an infinite loop */ ++ } while (out < n && (IO_STREAM_FILE(strm) != stderr) && restartable_io_error(strm, "fwrite")); ++ ++ ecl_enable_interrupts(); + return out; + } + diff --git a/gnu/packages/patches/ecl-16-libffi.patch b/gnu/packages/patches/ecl-16-libffi.patch new file mode 100644 index 0000000000..fc06a07606 --- /dev/null +++ b/gnu/packages/patches/ecl-16-libffi.patch @@ -0,0 +1,16 @@ +Patch adapted from Sage. Allows building ECL on libffi 3.3. +diff --git a/src/c/ffi.d b/src/c/ffi.d +index 8861303e..8a959c23 100644 +--- a/src/c/ffi.d ++++ b/src/c/ffi.d +@@ -133,8 +133,8 @@ static struct { + #elif defined(X86_WIN64) + {@':win64', FFI_WIN64}, + #elif defined(X86_ANY) || defined(X86) || defined(X86_64) +- {@':cdecl', FFI_SYSV}, +- {@':sysv', FFI_SYSV}, ++ {@':cdecl', FFI_UNIX64}, ++ {@':sysv', FFI_UNIX64}, + {@':unix64', FFI_UNIX64}, + #endif + }; diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm index 34fe9e524c..c94020f13e 100644 --- a/gnu/packages/sagemath.scm +++ b/gnu/packages/sagemath.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2019 Andreas Enge ;;; Copyright © 2019 Nicolas Goaziou ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -33,6 +34,7 @@ #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages image) + #:use-module (gnu packages lisp) #:use-module (gnu packages multiprecision) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) @@ -184,6 +186,27 @@ represented as strings.") (license license:public-domain) (home-page "https://github.com/miguelmarco/libhomfly"))) +;; Sage 9.1 doesn't build with ECL 20. This won't be necessary once 9.2 is +;; released. See https://trac.sagemath.org/ticket/22191 +(define-public ecl-16 + (package + (inherit ecl) + (version "16.1.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://common-lisp.net/project/ecl/static/files/release/ecl" + "-" version ".tgz")) + (sha256 + (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn")) + (patches (search-patches + "ecl-16-libffi.patch" + "ecl-16-ignore-stderr-write-error.patch" + "ecl-16-format-directive-limit.patch")))) + ;; Current ECL uses LGPL 2.1+ + (license license:lgpl2.0+))) + (define-public pynac (package (name "pynac") -- cgit v1.2.3 From 1649c7d69ae3fe4a3b94b6173431411a2c238168 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Wed, 1 Jul 2020 12:07:15 +0200 Subject: gnu: sqlite: Add locking-mode fix for the Hurd. * gnu/packages/patches/sqlite-hurd.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/sqlite.scm (sqlite)[native-inputs]: Add it when building for the Hurd. [arguments]: Apply it when building for the Hurd. --- gnu/local.mk | 1 + gnu/packages/patches/sqlite-hurd.patch | 58 ++++++++++++++++++++++++++++++++++ gnu/packages/sqlite.scm | 19 +++++++++++ 3 files changed, 78 insertions(+) create mode 100644 gnu/packages/patches/sqlite-hurd.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2fc9d7a0c7..3046a840c9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1374,6 +1374,7 @@ dist_patch_DATA = \ %D%/packages/patches/sdl-pango-header-guard.patch \ %D%/packages/patches/sdl-pango-matrix_declarations.patch \ %D%/packages/patches/sdl-pango-sans-serif.patch \ + %D%/packages/patches/sqlite-hurd.patch \ %D%/packages/patches/patchutils-test-perms.patch \ %D%/packages/patches/patch-hurd-path-max.patch \ %D%/packages/patches/perl-autosplit-default-time.patch \ diff --git a/gnu/packages/patches/sqlite-hurd.patch b/gnu/packages/patches/sqlite-hurd.patch new file mode 100644 index 0000000000..d80a2c5be8 --- /dev/null +++ b/gnu/packages/patches/sqlite-hurd.patch @@ -0,0 +1,58 @@ +Adapted from Debian: https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch +Upstream status: Not upstreamed. + +This patch is needed to get offloading to work. + +Sqlite can use simple file locking mode, but that does not work for the Hurd; +a second sqlite process fails with a "locking protocol" error. + +See also: https://bugs.debian.org/529734. + +diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c +--- sqlite-autoconf-3310100/sqlite3.c 2020-01-27 21:25:19.000000000 +0100 ++++ sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200 +@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode + # include + #endif + +-#if SQLITE_ENABLE_LOCKING_STYLE ++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__) + /* # include */ + # include + # include +@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id + ** + ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off + */ +-#if SQLITE_ENABLE_LOCKING_STYLE ++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__) + + /* + ** Retry flock() calls that fail with EINTR +@@ -38586,7 +38586,7 @@ IOMETHODS( + 0 /* xShmMap method */ + ) + +-#if SQLITE_ENABLE_LOCKING_STYLE ++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__) + IOMETHODS( + flockIoFinder, /* Finder function name */ + flockIoMethods, /* sqlite3_io_methods object name */ +@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){ + UNIXVFS("unix", autolockIoFinder ), + #elif OS_VXWORKS + UNIXVFS("unix", vxworksIoFinder ), ++#elif defined(__GNU__) ++ UNIXVFS("unix", flockIoFinder ), + #else + UNIXVFS("unix", posixIoFinder ), + #endif +@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){ + #if OS_VXWORKS + UNIXVFS("unix-namedsem", semIoFinder ), + #endif +-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS ++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__) + UNIXVFS("unix-posix", posixIoFinder ), + #endif + #if SQLITE_ENABLE_LOCKING_STYLE diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm index 8468131ddf..eeb77749d8 100644 --- a/gnu/packages/sqlite.scm +++ b/gnu/packages/sqlite.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2017 Jelle Licht ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Alex Vong +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,6 +30,7 @@ (define-module (gnu packages sqlite) #:use-module (gnu packages) + #:use-module (gnu packages hurd) #:use-module (gnu packages readline) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) @@ -65,6 +67,11 @@ "1bj936svd8i5g25xd1bj52hj4zca01fgl3sqkj86z9q5pkz4wa32")))) (build-system gnu-build-system) (inputs `(("readline" ,readline))) + (native-inputs (if (hurd-target?) + ;; TODO move into origin on the next rebuild cycle. + `(("hurd-locking-mode.patch" + ,@(search-patches "sqlite-hurd.patch"))) + '())) (outputs '("out" "static")) (arguments `(#:configure-flags @@ -79,6 +86,18 @@ ;; Column metadata is required by GNU Jami and Qt, et.al. "-DSQLITE_ENABLE_COLUMN_METADATA")) #:phases (modify-phases %standard-phases + ;; TODO: remove in the next rebuild cycle + ,@(if (hurd-target?) + `((add-after 'unpack 'patch-sqlite/hurd + (lambda* (#:key inputs native-inputs + #:allow-other-keys) + (let ((patch (assoc-ref + (if ,(%current-target-system) + native-inputs + inputs) + "hurd-locking-mode.patch"))) + (invoke "patch" "-p1" "--force" "-i" patch))))) + '()) (add-after 'install 'move-static-library (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) -- cgit v1.2.3 From bc6239ba078434cefe09194cba02ad1cfed87cc7 Mon Sep 17 00:00:00 2001 From: Jan Wielkiewicz Date: Sun, 12 Jul 2020 18:00:47 +0200 Subject: gnu: opendht: Add patch. The 2.1.4 release of opendht contains a bug, preventing it's use with recent releases of Jami. This minor patch [1] resolves this issue, and should be possible to remove with the next release. 1: https://github.com/savoirfairelinux/opendht/commit/e2b39dd3a0742853e00f9c3e8c46c911da20bed7 * gnu/packages/patches/opendht-fix-jami.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/networking.scm (opendht)[source]: Apply the patch. Signed-off-by: Christopher Baines --- gnu/local.mk | 1 + gnu/packages/networking.scm | 1 + gnu/packages/patches/opendht-fix-jami.patch | 33 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 gnu/packages/patches/opendht-fix-jami.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3046a840c9..57a1d0df84 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1344,6 +1344,7 @@ dist_patch_DATA = \ %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \ %D%/packages/patches/opencascade-oce-glibc-2.26.patch \ %D%/packages/patches/opencv-rgbd-aarch64-test-fix.patch \ + %D%/packages/patches/opendht-fix-jami.patch \ %D%/packages/patches/openfoam-4.1-cleanup.patch \ %D%/packages/patches/openjdk-10-idlj-reproducibility.patch \ %D%/packages/patches/openmpi-mtl-priorities.patch \ diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm index e6a9e69adf..44f81c94d1 100644 --- a/gnu/packages/networking.scm +++ b/gnu/packages/networking.scm @@ -2918,6 +2918,7 @@ and targeted primarily for asynchronous processing of HTTP-requests.") (url "https://github.com/savoirfairelinux/opendht.git") (commit version))) (file-name (git-file-name name version)) + (patches (search-patches "opendht-fix-jami.patch")) (sha256 (base32 "1ax26ri1ifb6s8ppd28jmanka9yf8mw3np65q2h4djhhik0phhal")))) diff --git a/gnu/packages/patches/opendht-fix-jami.patch b/gnu/packages/patches/opendht-fix-jami.patch new file mode 100644 index 0000000000..9718a84a41 --- /dev/null +++ b/gnu/packages/patches/opendht-fix-jami.patch @@ -0,0 +1,33 @@ +From e2b39dd3a0742853e00f9c3e8c46c911da20bed7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Adrien=20B=C3=A9raud?= +Date: Tue, 30 Jun 2020 10:42:49 -0400 +Subject: [PATCH 1/4] http/request: make terminate public + +--- + include/opendht/http.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/include/opendht/http.h b/include/opendht/http.h +index cc8d5f9..46b722c 100644 +--- a/include/opendht/http.h ++++ b/include/opendht/http.h +@@ -294,6 +294,7 @@ public: + * User action to cancel the Request and call the completion callbacks. + */ + void cancel(); ++ void terminate(const asio::error_code& ec); + + private: + using OnCompleteCb = std::function; +@@ -320,8 +321,6 @@ private: + + void connect(std::vector&& endpoints, HandlerCb cb = {}); + +- void terminate(const asio::error_code& ec); +- + void post(); + + void handle_request(const asio::error_code& ec); +-- +2.27.0 + -- cgit v1.2.3 From 000498784f4aae34742b28e72175cebce4cff01e Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 13 Jul 2020 09:02:56 +0300 Subject: gnu: libreoffice: Update to 6.4.5.2. * gnu/packages/libreoffice.scm (libreoffice): Update to 6.4.5.2. [source]: Remove patch. * gnu/packages/patches/libreoffice-poppler-compat.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/libreoffice.scm | 5 ++--- gnu/packages/patches/libreoffice-poppler-compat.patch | 19 ------------------- 3 files changed, 2 insertions(+), 23 deletions(-) delete mode 100644 gnu/packages/patches/libreoffice-poppler-compat.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 57a1d0df84..8494c5e305 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1211,7 +1211,6 @@ dist_patch_DATA = \ %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch \ %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch \ %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch \ - %D%/packages/patches/libreoffice-poppler-compat.patch \ %D%/packages/patches/libsndfile-armhf-type-checks.patch \ %D%/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch \ %D%/packages/patches/libsndfile-CVE-2017-8362.patch \ diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm index a98ae152f6..ebe4fd7246 100644 --- a/gnu/packages/libreoffice.scm +++ b/gnu/packages/libreoffice.scm @@ -1049,7 +1049,7 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.") (define-public libreoffice (package (name "libreoffice") - (version "6.4.4.2") + (version "6.4.5.2") (source (origin (method url-fetch) @@ -1057,10 +1057,9 @@ converting QuarkXPress file format. It supports versions 3.1 to 4.1.") (string-append "https://download.documentfoundation.org/libreoffice/src/" (version-prefix version 3) "/libreoffice-" version ".tar.xz")) - (patches (search-patches "libreoffice-poppler-compat.patch")) (sha256 (base32 - "0y6026h374787yy2f3as1q7clxmgywsfdrj62kw3577wvybqaf2l")))) + "1v4ili9j8d0xfj3q69niski1v65icg8xi09ip2bsk343rawwck3a")))) (build-system glib-or-gtk-build-system) (native-inputs `(("bison" ,bison) diff --git a/gnu/packages/patches/libreoffice-poppler-compat.patch b/gnu/packages/patches/libreoffice-poppler-compat.patch deleted file mode 100644 index 8dc0b60a12..0000000000 --- a/gnu/packages/patches/libreoffice-poppler-compat.patch +++ /dev/null @@ -1,19 +0,0 @@ -Fix type mismatch with Poppler 0.86. - -Taken from Arch Linux: -https://git.archlinux.org/svntogit/packages.git/tree/trunk/libreoffice-poppler-0.86.patch?h=packages/libreoffice-fresh - -diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx ---- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx -+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx -@@ -563,7 +563,9 @@ void PDFOutDev::processLink(Link* link, Catalog*) - if (!(pAction && pAction->getKind() == actionURI)) - return; - --#if POPPLER_CHECK_VERSION(0, 72, 0) -+#if POPPLER_CHECK_VERSION(0, 86, 0) -+ const char* pURI = static_cast(pAction)->getURI().c_str(); -+#elif POPPLER_CHECK_VERSION(0, 72, 0) - const char* pURI = static_cast(pAction)->getURI()->c_str(); - #else - const char* pURI = static_cast(pAction)->getURI()->getCString(); -- cgit v1.2.3 From dab195957bdd75eba49ee3d08adc5ff805d4f497 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 27 Jun 2020 15:11:05 +0200 Subject: gnu: xpra: Upgrade to 4.0.2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/xorg.scm (xpra)[version]: Upgrade. [source]: Add patch. [inputs]: Adjust to use Python 3 dependencies. [arguments]: Use Python 3, add phases to patch hardcoded binary paths. * gnu/local.mk (dist_patch_DATA): Add patch. * gnu/packages/patches/xpra-4.0.1-systemd-run.patch: New file. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/patches/xpra-4.0.1-systemd-run.patch | 34 +++++ gnu/packages/xorg.scm | 153 +++++++++++++--------- 3 files changed, 123 insertions(+), 65 deletions(-) create mode 100644 gnu/packages/patches/xpra-4.0.1-systemd-run.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8494c5e305..ddd024677a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1637,6 +1637,7 @@ dist_patch_DATA = \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ %D%/packages/patches/xplanet-1.3.1-xpUtil-Add2017LeapSecond.cpp.patch \ + %D%/packages/patches/xpra-4.0.1-systemd-run.patch \ %D%/packages/patches/xsane-fix-memory-leak.patch \ %D%/packages/patches/xsane-fix-pdf-floats.patch \ %D%/packages/patches/xsane-fix-snprintf-buffer-length.patch \ diff --git a/gnu/packages/patches/xpra-4.0.1-systemd-run.patch b/gnu/packages/patches/xpra-4.0.1-systemd-run.patch new file mode 100644 index 0000000000..1ea11830a5 --- /dev/null +++ b/gnu/packages/patches/xpra-4.0.1-systemd-run.patch @@ -0,0 +1,34 @@ +Disable systemd-run if the command is not found. + +diff -Naur xpra-4.0.1/xpra/scripts/main.py xpra-4.0.1.patched/xpra/scripts/main.py +--- xpra-4.0.1/xpra/scripts/main.py 2020-05-17 18:12:15.000000000 +0200 ++++ xpra-4.0.1.patched/xpra/scripts/main.py 2020-06-01 12:12:18.500257507 +0200 +@@ -312,16 +312,18 @@ + if not is_systemd_pid1(): + return False + #test it: +- cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"] +- proc = Popen(cmd, stdin=None, stdout=None, stderr=None, shell=False) +- r = pollwait(proc, timeout=1) +- if r is None: +- try: +- proc.terminate() +- except Exception: +- pass +- return r==0 +- ++ try: ++ cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"] ++ proc = Popen(cmd, stdin=None, stdout=None, stderr=None, shell=False) ++ r = pollwait(proc, timeout=1) ++ if r is None: ++ try: ++ proc.terminate() ++ except Exception: ++ pass ++ return r==0 ++ except FileNotFoundError: ++ return False + + def run_mode(script_file, error_cb, options, args, mode, defaults): + #configure default logging handler: diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 95cd49cf25..19873073d0 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -6276,7 +6276,7 @@ basic eye-candy effects.") (define-public xpra (package (name "xpra") - (version "2.5.3") + (version "4.0.2") (source (origin (method url-fetch) @@ -6284,85 +6284,108 @@ basic eye-candy effects.") version ".tar.xz")) (sha256 (base32 - "1ys35lj28903alccks9p055psy1fsk1nxi8ncchvw8bfxkkkvbys")))) + "1cs39jzi59hkl421xmhi549ndmdfzkg0ap45f4nlsn9zr9zwmp3x")) + (patches (search-patches "xpra-4.0.1-systemd-run.patch")))) (build-system python-build-system) - (inputs `(("ffmpeg" ,ffmpeg) - ("flac" ,flac) - ("gtk+-2" ,gtk+-2) ;; no full GTK3 support yet + ;; see also http://xpra.org/trac/wiki/Dependencies + (inputs `( + ;; Essential dependencies. ("libjpeg" ,libjpeg-turbo) - ("libpng" ,libpng) - ("libvpx" ,libvpx) - ("libx264" ,libx264) - ("libxcomposite" ,libxcomposite) - ("libxdamage" ,libxdamage) - ("libxi" ,libxi) - ("libxkbfile" ,libxkbfile) + ("libwebp" ,libwebp) + ("ffmpeg" ,ffmpeg) + ("libx11" ,libx11) ("libxrandr" ,libxrandr) ("libxtst" ,libxtst) - ("lzo" ,lzo) - ("python2-cryptography" ,python2-cryptography) - ("python2-dbus" ,python2-dbus) - ("python2-lz4" ,python2-lz4) - ("python2-lzo" ,python2-lzo) - ("python2-netifaces" ,python2-netifaces) - ("python2-numpy" ,python2-numpy) - ("python2-pillow" ,python2-pillow) - ("python2-pycairo" ,python2-pycairo) - ("python2-pycrypto" ,python2-pycrypto) - ("python2-pygobject" ,python2-pygobject) - ("python2-pyopengl" ,python2-pyopengl) - ("python2-pyopengl-accelerate" ,python2-pyopengl-accelerate) - ("python2-pygtk" ,python2-pygtk) - ("python2-rencode" ,python2-rencode) - ("xorg-server" ,xorg-server))) + ("libxfixes" ,libxfixes) + ("libxkbfile" ,libxkbfile) + ("libxcomposite" ,libxcomposite) + ("libxdamage" ,libxdamage) + ("libxext" ,libxext) + ("gtk+" ,gtk+) + ("python-pycairo" ,python-pycairo) + ("python-pygobject" ,python-pygobject) + ("xauth" ,xauth) + ("xorg-server" ,xorg-server) + ("xf86-video-dummy" ,xf86-video-dummy) + ("xf86-input-mouse" ,xf86-input-mouse) + ("xf86-input-keyboard" ,xf86-input-keyboard) + ("python-pillow" ,python-pillow) + ;; Optional dependencies. + ("python-rencode" ,python-rencode) ; For speed. + ("python-numpy", python-numpy) + ("python-pyopengl" ,python-pyopengl) ; Drawing acceleration. + ("python-pyopengl-accelerate" ,python-pyopengl-accelerate) ; Same. + ("python-paramiko" ,python-paramiko) ; Tunneling over SSH. + ("python-dbus" ,python-dbus) ; For desktop notifications. + ("dbus" ,dbus) ; For dbus-launch command. + ("python-lz4" ,python-lz4) ; Faster compression than zlib. + ("python-netifaces" ,python-netifaces))) (native-inputs `(("pkg-config" ,pkg-config) - ("python2-cython" ,python2-cython))) + ("python-cython" ,python-cython))) (arguments - `(#:python ,python-2 ;; no full Python 3 support yet - #:configure-flags '("--with-tests" - "--with-bundle_tests" - "--without-Xdummy" ;; We use Xvfb instead. - "--without-Xdummy_wrapper" - "--without-strict") + `(#:configure-flags '("--without-Xdummy" + "--without-Xdummy_wrapper" + "--with-opengl" + "--without-debug" + "--without-strict") ; Ignore compiler warnings. #:modules ((guix build python-build-system) (guix build utils)) - + #:tests? #f ; Do not run test-cases. This would rebuild all modules and + ; they seem to require python2. #:phases (modify-phases %standard-phases + ;; built by 'install phase (delete 'build) - (delete 'check) ;; There's no test suite at the moment. - - ;; Remove BUILD_CPU, BUILD_DATE, BUILD_TIME from build info to - ;; prevent deterministic issues. Also correct some directories and - ;; use the xvfb binary instead of xorg-server (which doesn't seem to - ;; work). - (add-before 'install 'remove-timestamps&set-file-names + (add-before 'install 'fix-paths (lambda* (#:key inputs outputs #:allow-other-keys) - (substitute* "add_build_info.py" - ((".*\"BUILD_CPU\", get_cpuinfo.*") "")) - (substitute* "add_build_info.py" - ((".*\"BUILD_DATE\", datetime.*") "")) - (substitute* "add_build_info.py" - ((".*\"BUILD_TIME\", datetime.*") "")) - (substitute* "setup.py" - (("/etc/init.d/") - (string-append (assoc-ref outputs "out") - "/etc/init.d/"))) - (substitute* "setup.py" - (("/usr/lib/") - (string-append (assoc-ref outputs "out") "/lib/"))) - ;; Use Xvfb with '-nolisten local' to disable abstract X11 sockets. - (substitute* "./xpra/scripts/config.py" - ((":.*join.*xvfb.*") - (string-append ": \"" (assoc-ref inputs "xorg-server") - "/bin/Xvfb +extension Composite" - " -screen 0 5760x2560x24+32 -dpi 96 -nolisten" - " tcp -nolisten local -noreset -auth" - " $XAUTHORITY\",\n"))) + ;; Fix binary paths. + (substitute* '("xpra/scripts/config.py" "xpra/x11/vfb_util.py") + (("\"Xvfb\"") + (string-append "\"" (assoc-ref inputs "xorg-server") "/bin/Xvfb\"")) + (("\"Xorg\"") + (string-append "\"" (assoc-ref inputs "xorg-server") "/bin/Xorg\"")) + (("\"xauth\"") + (string-append "\"" (assoc-ref inputs "xauth") "/bin/xauth\""))) + ;; Fix directory of config files. + (substitute* '("xpra/scripts/config.py" "xpra/platform/xposix/paths.py") + (("\"/etc/xpra/?\"") + (string-append "\"" (assoc-ref outputs "out") "/etc/xpra/\""))) + ;; XXX: Stolen from (gnu packages linux) + (define (append-to-file name body) + (let ((file (open-file name "a"))) + (display body file) + (close-port file))) + ;; Add Xorg module paths. + (append-to-file + "etc/xpra/xorg.conf" + (string-append "\nSection \"Files\"\nModulePath \"" + (assoc-ref inputs "xf86-video-dummy") "/lib/xorg/modules," + (assoc-ref inputs "xf86-input-mouse") "/lib/xorg/modules," + (assoc-ref inputs "xf86-input-keyboard") "/lib/xorg/modules," + (assoc-ref inputs "xorg-server") "/lib/xorg/modules\"\n" + "EndSection\n\n")) + (substitute* '("xpra/scripts/config.py" + "etc/xpra/conf.d/60_server.conf.in" + "unittests/unit/server/mixins/notification_test.py") + ;; The trailing -- is intentional, so we only replace it inside + ;; a command line. + (("dbus-launch --") + (string-append (assoc-ref inputs "dbus") "/bin/dbus-launch --"))) + ;; /run/user does not exist on guix system (substitute* "./xpra/scripts/config.py" (("socket-dir.*: \"\",") "socket-dir\" : \"~/.xpra\",")) - #t))))) + #t)) + ;; GTK3 will not be found, if GI can’t find its typelibs. + (add-after + 'install 'wrap-program + (lambda* (#:key outputs #:allow-other-keys) + (let ((prog (string-append (assoc-ref outputs "out") + "/bin/xpra"))) + ;; XXX: only export typelibs in inputs + (wrap-program prog + `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))) + #t)))))) (home-page "https://www.xpra.org/") (synopsis "Remote access to individual applications or full desktops") (description "Xpra is a persistent remote display server and client for -- cgit v1.2.3 From dec0217f6e21a2f48328aaff5448dcf2f4fea7d9 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 15 Jul 2020 20:08:10 +0200 Subject: gnu: python-shiboken-2, python-pyside-2: Update to 5.14.2.3. * gnu/packages/patches/qtbase-absolute-runpath.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/qt.scm (qtbase/next): New variable. * gnu/packages/qt.scm (python-shiboken-2): Update to 5.14.2.3. [source](uri): Adjust for tarball rename. [inputs]: Use the default CLANG-TOOLCHAIN. (python-pyside-2)[inputs]: Likewise. (python-pyside-2-tools)[inputs]: Change from QTBASE to QTBASE/NEXT. --- gnu/local.mk | 1 + gnu/packages/patches/qtbase-absolute-runpath.patch | 17 +++++++++++++++ gnu/packages/qt.scm | 24 ++++++++++++++++------ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 gnu/packages/patches/qtbase-absolute-runpath.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index ddd024677a..9b42160de3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1473,6 +1473,7 @@ dist_patch_DATA = \ %D%/packages/patches/qemu-glibc-2.27.patch \ %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ + %D%/packages/patches/qtbase-absolute-runpath.patch \ %D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \ %D%/packages/patches/qtbase-use-TZDIR.patch \ %D%/packages/patches/qtscript-disable-tests.patch \ diff --git a/gnu/packages/patches/qtbase-absolute-runpath.patch b/gnu/packages/patches/qtbase-absolute-runpath.patch new file mode 100644 index 0000000000..cec4ddc0a3 --- /dev/null +++ b/gnu/packages/patches/qtbase-absolute-runpath.patch @@ -0,0 +1,17 @@ +Do not use $ORIGIN in RUNPATH so that executables can be copied elsewhere and +still be expected to work (needed for python-pyside-2-tools). + +diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf +--- a/mkspecs/common/linux.conf ++++ b/mkspecs/common/linux.conf +@@ -10,8 +10,8 @@ QMAKE_CFLAGS_THREAD += -D_REENTRANT + QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD + QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections + +-QMAKE_LFLAGS_REL_RPATH = -Wl,-z,origin +-QMAKE_REL_RPATH_BASE = $ORIGIN ++QMAKE_LFLAGS_REL_RPATH = ++QMAKE_REL_RPATH_BASE = + + QMAKE_INCDIR = + QMAKE_LIBDIR = diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 7e9036c4b4..0cb36427a0 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -596,6 +596,18 @@ developers using C++ or QML, a CSS & JavaScript like language.") ;; qt used to refer to the monolithic Qt 5.x package (define-deprecated qt qtbase) +;; This variable is required by 'python-pyside-2-tools', which copies some +;; qtbase executables that fail to run because RUNPATH refers to the +;; wrong $ORIGIN. TODO: Merge with qtbase in the next rebuild cycle. +(define qtbase/next + (package + (inherit qtbase) + (source + (origin + (inherit (package-source qtbase)) + (patches (append (origin-patches (package-source qtbase)) + (search-patches "qtbase-absolute-runpath.patch"))))))) + (define-public qtsvg (package (inherit qtbase) (name "qtsvg") @@ -2566,19 +2578,19 @@ color-related widgets.") (define-public python-shiboken-2 (package (name "python-shiboken-2") - (version "5.12.6") + (version "5.14.2.3") (source (origin (method url-fetch) (uri (string-append "https://download.qt.io/official_releases" "/QtForPython/pyside2/PySide2-" version - "-src/pyside-setup-everywhere-src-" + "-src/pyside-setup-opensource-src-" version ".tar.xz")) (sha256 (base32 - "1n45l6xxyxs6cfp2l4rp8qs1c2fyfwyrdxa4qcpwfsqsi51rydsk")))) + "08lhqm0n3fjqpblcx9rshsp8g3bvf7yzbai5q99bly2wa04y6b83")))) (build-system cmake-build-system) (inputs - `(("clang-toolchain" ,clang-toolchain-6) + `(("clang-toolchain" ,clang-toolchain) ("libxml2" ,libxml2) ("libxslt" ,libxslt) ("python-wrapper" ,python-wrapper) @@ -2631,7 +2643,7 @@ color-related widgets.") (inputs `(("libxml2" ,libxml2) ("libxslt" ,libxslt) - ("clang-toolchain" ,clang-toolchain-6) + ("clang-toolchain" ,clang-toolchain) ("qtbase" ,qtbase) ("qtdatavis3d" ,qtdatavis3d) ("qtlocation" ,qtlocation) @@ -2699,7 +2711,7 @@ generate Python bindings for your C or C++ code.") (inputs `(("python-pyside-2" ,python-pyside-2) ("python-shiboken-2" ,python-shiboken-2) - ("qtbase" ,qtbase))) + ("qtbase" ,qtbase/next))) (native-inputs `(("python" ,python-wrapper))) (arguments -- cgit v1.2.3 From 15076369062852c266bc697fc54b2ba157aceed0 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 15 Jul 2020 20:29:26 +0200 Subject: gnu: python-tinycss2: Fix test failure. Fixes . Reported by Michael Rohleder . * gnu/packages/patches/python-tinycss2-flake8-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/python-web.scm (python-tinycss2)[source](patches): New field. --- gnu/local.mk | 1 + .../patches/python-tinycss2-flake8-compat.patch | 36 ++++++++++++++++++++++ gnu/packages/python-web.scm | 1 + 3 files changed, 38 insertions(+) create mode 100644 gnu/packages/patches/python-tinycss2-flake8-compat.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 9b42160de3..2f59279977 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1466,6 +1466,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch \ %D%/packages/patches/python-slugify-depend-on-unidecode.patch \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ + %D%/packages/patches/python-tinycss2-flake8-compat.patch \ %D%/packages/patches/python-unittest2-python3-compat.patch \ %D%/packages/patches/python-unittest2-remove-argparse.patch \ %D%/packages/patches/python-waitress-fix-tests.patch \ diff --git a/gnu/packages/patches/python-tinycss2-flake8-compat.patch b/gnu/packages/patches/python-tinycss2-flake8-compat.patch new file mode 100644 index 0000000000..a66eb42fa1 --- /dev/null +++ b/gnu/packages/patches/python-tinycss2-flake8-compat.patch @@ -0,0 +1,36 @@ +Fix test failure that occurs with recent versions of Flake8. + +Taken from upstream: +https://github.com/Kozea/tinycss2/commit/6556604fb98c2153412384d6f0f705db2da1aa60 + +diff --git a/tinycss2/css-parsing-tests/make_color3_hsl.py b/tinycss2/css-parsing-tests/make_color3_hsl.py +index d1fd3a6..56fda0c 100644 +--- a/tinycss2/css-parsing-tests/make_color3_hsl.py ++++ b/tinycss2/css-parsing-tests/make_color3_hsl.py +@@ -8,16 +8,17 @@ def trim(s): + print('[') + print(',\n'.join( + '"hsl%s(%s, %s%%, %s%%%s)", [%s, %s, %s, %s]' % ( +- ('a' if a is not None else '', h, +- trim(str(s / 10.)), trim(str(l / 10.)), +- ', %s' % a if a is not None else '') + ++ ('a' if alpha is not None else '', hue, ++ trim(str(saturation / 10.)), trim(str(light / 10.)), ++ ', %s' % alpha if alpha is not None else '') + + tuple(trim(str(round(v, 10))) +- for v in colorsys.hls_to_rgb(h / 360., l / 1000., s / 1000.)) + +- (a if a is not None else 1,) ++ for v in colorsys.hls_to_rgb( ++ hue / 360., light / 1000., saturation / 1000.)) + ++ (alpha if alpha is not None else 1,) + ) +- for a in [None, 1, .2, 0] +- for l in range(0, 1001, 125) +- for s in range(0, 1001, 125) +- for h in range(0, 360, 30) ++ for alpha in [None, 1, .2, 0] ++ for light in range(0, 1001, 125) ++ for saturation in range(0, 1001, 125) ++ for hue in range(0, 360, 30) + )) + print(']') diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index a7e5e7081f..1d7cfd852d 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -3411,6 +3411,7 @@ library to create slugs from unicode strings while keeping it DRY.") (origin (method url-fetch) (uri (pypi-uri "tinycss2" version)) + (patches (search-patches "python-tinycss2-flake8-compat.patch")) (sha256 (base32 "1kw84y09lggji4krkc58jyhsfj31w8npwhznr7lf19d0zbix09v4")))) (build-system python-build-system) -- cgit v1.2.3 From 7233b19fde688d79d19ed1614a804c1d80f55260 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 10 Jun 2020 21:28:53 -0400 Subject: gnu: Transmission: Update to 3.0.0. * gnu/packages/bittorrent.scm (transmission): Update to 3.0.0. [source]: Remove obsolete patch. * gnu/packages/patches/transmission-CVE-2018-10756.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/bittorrent.scm | 14 ++--- .../patches/transmission-CVE-2018-10756.patch | 71 ---------------------- 3 files changed, 6 insertions(+), 80 deletions(-) delete mode 100644 gnu/packages/patches/transmission-CVE-2018-10756.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2f59279977..7ed634a7a8 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1568,7 +1568,6 @@ dist_patch_DATA = \ %D%/packages/patches/tipp10-fix-compiling.patch \ %D%/packages/patches/tipp10-remove-license-code.patch \ %D%/packages/patches/tk-find-library.patch \ - %D%/packages/patches/transmission-CVE-2018-10756.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/ttfautohint-source-date-epoch.patch \ %D%/packages/patches/tomb-fix-errors-on-open.patch \ diff --git a/gnu/packages/bittorrent.scm b/gnu/packages/bittorrent.scm index be10a34a6c..b124e17d76 100644 --- a/gnu/packages/bittorrent.scm +++ b/gnu/packages/bittorrent.scm @@ -65,16 +65,15 @@ (define-public transmission (package (name "transmission") - (version "2.94") + (version "3.00") (source (origin (method url-fetch) - (uri (string-append - "https://github.com/transmission/transmission-releases/raw/" - "master/transmission-" version ".tar.xz")) - (patches (search-patches "transmission-CVE-2018-10756.patch")) + (uri (string-append "https://github.com/transmission/transmission" + "/releases/download/" version "/transmission-" + version ".tar.xz")) (sha256 (base32 - "0zbbj7rlm6m7vb64x68a64cwmijhsrwx9l63hbwqs7zr9742qi1m")))) + "1wjmn96zrvmk8j1yz2ysmqd7a2x6ilvnwwapcvfzgxs2wwpnai4i")))) (build-system glib-or-gtk-build-system) (outputs '("out" ; library and command-line interface "gui")) ; graphical user interface @@ -90,8 +89,7 @@ (gui (assoc-ref outputs "gui"))) (mkdir-p (string-append gui "/bin")) (rename-file (string-append out "/bin/transmission-gtk") - (string-append gui - "/bin/transmission-gtk")) + (string-append gui "/bin/transmission-gtk")) ;; Move the '.desktop' and icon files as well. (mkdir (string-append gui "/share")) diff --git a/gnu/packages/patches/transmission-CVE-2018-10756.patch b/gnu/packages/patches/transmission-CVE-2018-10756.patch deleted file mode 100644 index f9bdcf60aa..0000000000 --- a/gnu/packages/patches/transmission-CVE-2018-10756.patch +++ /dev/null @@ -1,71 +0,0 @@ -Fix CVE-2018-10756: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-10756 - -Patch copied from Fedora: - -https://src.fedoraproject.org/rpms/transmission/blob/master/f/2123adf8e5e1c2b48791f9d22fc8c747e974180e.patch - ---- a/libtransmission/variant.c 2018-05-01 12:21:08.000000000 -0500 -+++ b/libtransmission/variant.c 2020-05-18 10:21:27.554214128 -0500 -@@ -820,7 +820,7 @@ - struct SaveNode - { - const tr_variant * v; -- tr_variant sorted; -+ tr_variant* sorted; - size_t childIndex; - bool isVisited; - }; -@@ -849,26 +849,33 @@ - - qsort (tmp, n, sizeof (struct KeyIndex), compareKeyIndex); - -- tr_variantInitDict (&node->sorted, n); -+ node->sorted = tr_new(tr_variant, 1); -+ tr_variantInitDict (node->sorted, n); - for (i=0; isorted.val.l.vals[i] = *tmp[i].val; -+ node->sorted->val.l.vals[i] = *tmp[i].val; - node->sorted.val.l.count = n; - - tr_free (tmp); - -- node->v = &node->sorted; -+ v = node->sorted; - } - else - { -- node->v = v; -+ node->sorted = NULL; - } -+ -+ node->v = v; - } - - static void - nodeDestruct (struct SaveNode * node) - { -- if (node->v == &node->sorted) -- tr_free (node->sorted.val.l.vals); -+ //TR_ASSERT(node != NULL); -+ if (node->sorted != NULL) -+ { -+ tr_free(node->sorted->val.l.vals); -+ tr_free(node->sorted); -+ } - } - - /** ---- a/libtransmission/variant.c 2020-05-18 10:21:49.000000000 -0500 -+++ b/libtransmission/variant.c 2020-05-18 10:24:34.673648865 -0500 -@@ -853,7 +853,7 @@ - tr_variantInitDict (node->sorted, n); - for (i=0; isorted->val.l.vals[i] = *tmp[i].val; -- node->sorted.val.l.count = n; -+ node->sorted->val.l.count = n; - - tr_free (tmp); - - -- cgit v1.2.3 From f5340e004590d3775157b335efa8a1525605a55c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 10 Jul 2020 17:48:06 +0200 Subject: gnu: Add tao. * gnu/packages/patches/tao-add-missing-headers.patch, gnu/packages/patches/tao-fix-parser-types.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/audio.scm (tao): New variable. --- gnu/local.mk | 2 + gnu/packages/audio.scm | 71 ++++++++++++++ gnu/packages/patches/tao-add-missing-headers.patch | 102 +++++++++++++++++++++ gnu/packages/patches/tao-fix-parser-types.patch | 26 ++++++ 4 files changed, 201 insertions(+) create mode 100644 gnu/packages/patches/tao-add-missing-headers.patch create mode 100644 gnu/packages/patches/tao-fix-parser-types.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 7ed634a7a8..f7c6036ee7 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1548,6 +1548,8 @@ dist_patch_DATA = \ %D%/packages/patches/t1lib-CVE-2011-0764.patch \ %D%/packages/patches/t1lib-CVE-2011-1552+.patch \ %D%/packages/patches/t4k-common-libpng16.patch \ + %D%/packages/patches/tao-add-missing-headers.patch \ + %D%/packages/patches/tao-fix-parser-types.patch \ %D%/packages/patches/tar-remove-wholesparse-check.patch \ %D%/packages/patches/tar-skip-unreliable-tests.patch \ %D%/packages/patches/tcc-boot-0.9.27.patch \ diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 736b934d79..e3085b8a7f 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -70,6 +70,7 @@ #:use-module (gnu packages fontutils) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) + #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gnunet) ; libmicrohttpd @@ -861,6 +862,76 @@ flanger), ringmodulator, distortion, filters, pitchshift, oscillators, emulation (valve, tape), bit fiddling (decimator, pointer-cast), etc.") (license license:gpl3+))) +(define-public tao + (package + (name "tao") + (version "1.0-beta-10May2006") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/taopm/Tao/" + "tao-" version "/" + "tao-" version ".tar.gz")) + (sha256 + (base32 + "156py3g6mmglldfd0j76bn7n242hdwf49diaprjpj7crp8vgf2pz")) + (patches + (search-patches "tao-add-missing-headers.patch" + "tao-fix-parser-types.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "configure" + (("SHELL=/bin/sh") "")) + #t)))) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("TAO_RELEASE=-beta") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-references + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "user-scripts/tao.in" + (("taoparse") + (string-append (assoc-ref outputs "out") "/bin/taoparse")) + (("grep") (which "grep")) + (("sed -f \\$distdir/user-scripts/") + (string-append (which "sed") " -f $distdir/")) + (("distdir=.*") + (string-append "distdir=" + (assoc-ref outputs "out") "/share/tao"))) + #t)) + (add-after 'install 'install-extra-files + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (share (string-append out "/share/tao/")) + (inc (string-append out "/include/tao/"))) + (mkdir-p share) + (mkdir-p inc) + (install-file "user-scripts/error.parse" share) + (copy-recursively "examples" (string-append share "examples")) + (for-each (lambda (file) (install-file file inc)) + (find-files "include" "\\.h")) + #t)))))) + (inputs + `(("audiofile" ,audiofile) + ("libxi" ,libxi) + ("libxmu" ,libxmu) + ("mesa" ,mesa) + ("glut" ,freeglut) + ("flex" ,flex) + ("bison" ,bison) + ("sed" ,sed) + ("grep" ,grep))) + (home-page "http://taopm.sourceforge.net/") + (synopsis "Sound Synthesis with Physical Models") + (description "Tao is a software package for sound synthesis using physical +models. It provides a virtual acoustic material constructed from masses and +springs which can be used as the basis for building quite complex virtual +musical instruments. Tao comes with a synthesis language for creating and +playing instruments and a C++ API for those who would like to use it as an +object library.") + (license license:gpl2+))) + (define-public csound (package (name "csound") diff --git a/gnu/packages/patches/tao-add-missing-headers.patch b/gnu/packages/patches/tao-add-missing-headers.patch new file mode 100644 index 0000000000..f117281993 --- /dev/null +++ b/gnu/packages/patches/tao-add-missing-headers.patch @@ -0,0 +1,102 @@ +Taken from Debian: +https://salsa.debian.org/multimedia-team/taopm/-/raw/master/debian/patches/01-add-missing-headers.diff + +Description: Adding missing headers +Author: Tiago Bortoletto Vaz +Last-Update: 2013-04-17 +--- a/libtao/Tao.cc ++++ b/libtao/Tao.cc +@@ -18,6 +18,7 @@ + + #include "Tao.h" + #include ++#include + + extern Tao tao; + float &Time = tao.synthesisEngine.time; +--- a/libtao/TaoDevice.cc ++++ b/libtao/TaoDevice.cc +@@ -20,6 +20,7 @@ + #include "Tao.h" + #include "TaoAccessPoint.h" + #include "TaoInstrument.h" ++#include + + TaoDevice::TaoDevice() + { +--- a/libtao/TaoInstrument.cc ++++ b/libtao/TaoInstrument.cc +@@ -23,6 +23,7 @@ + //#include + #include + #include ++#include + + float TaoInstrument::defaultMass=3.5; // Set to optimum value for + // frequency response of +--- a/libtao/TaoOutput.cc ++++ b/libtao/TaoOutput.cc +@@ -24,6 +24,7 @@ + #include + #include "TaoOutput.h" + #include "Tao.h" ++#include + + extern Tao tao; + +--- a/libtao/TaoPitch.cc ++++ b/libtao/TaoPitch.cc +@@ -30,6 +30,7 @@ + #include "TaoPitch.h" + #include + #include ++#include + + // This class allows pitches and frequencies to be specified in a number of + // different formats including the following: +--- a/taoparse/taoparser.yy ++++ b/taoparse/taoparser.yy +@@ -19,7 +19,8 @@ + + #include + #include +-#include ++#include ++#include + #include "taoparserdefs.h" + + int yyerror(char *s); +--- a/libtao/TaoGraphicsEngine.cc ++++ b/libtao/TaoGraphicsEngine.cc +@@ -27,7 +27,8 @@ + #include "TaoInstrument.h" + #include "TaoAccessPoint.h" + #include "TaoDevice.h" +-#include ++#include ++#include + + extern Tao tao; + extern void taoMasterTick(); +--- a/tao2aiff/tao2aiff.cc ++++ b/tao2aiff/tao2aiff.cc +@@ -25,6 +25,8 @@ + #include + #include "audiofile.h" + #include "tao2aiff.h" ++#include ++#include + + + main(int argc, char **argv) +--- a/tao2wav/tao2wav.cc ++++ b/tao2wav/tao2wav.cc +@@ -25,6 +25,8 @@ + #include + #include "audiofile.h" + #include "tao2wav.h" ++#include ++#include + + main(int argc, char **argv) + { diff --git a/gnu/packages/patches/tao-fix-parser-types.patch b/gnu/packages/patches/tao-fix-parser-types.patch new file mode 100644 index 0000000000..5dcf3fc2ea --- /dev/null +++ b/gnu/packages/patches/tao-fix-parser-types.patch @@ -0,0 +1,26 @@ +Taken from Debian: +https://salsa.debian.org/multimedia-team/taopm/-/raw/master/debian/patches/02-fix-parser-yyerror.diff + +Description: Use a constant char, dummy comment. +Author: Tiago Bortoletto Vaz +Last-Update: 2013-04-17 +--- a/taoparse/taoparser.yy ++++ b/taoparse/taoparser.yy +@@ -23,7 +23,7 @@ + #include + #include "taoparserdefs.h" + +-int yyerror(char *s); ++int yyerror(const char *s); + + //#ifdef LINUX + int yylex(void); +@@ -2924,7 +2924,7 @@ + } + + +-int yyerror (char *s) ++int yyerror (const char *s) + { + parse_error(what_I_expected_here); + std::cout << "PARSE_FAILED"; -- cgit v1.2.3 From 72a91d74cec01bfcfcef2b62c5b327fab82950b6 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 3 Jul 2020 00:28:57 +0200 Subject: gnu: Add ganeti. * gnu/packages/virtualization.scm (system->qemu-target, ganeti): New variables. * gnu/packages/patches/ganeti-deterministic-manual.patch, gnu/packages/patches/ganeti-disable-version-symlinks.patch, gnu/packages/patches/ganeti-drbd-compat.patch, gnu/packages/patches/ganeti-haskell-pythondir.patch, gnu/packages/patches/ganeti-os-disk-size.patch, gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch, gnu/packages/patches/ganeti-shepherd-master-failover.patch, gnu/packages/patches/ganeti-shepherd-support.patch: New files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. --- gnu/local.mk | 8 + .../patches/ganeti-deterministic-manual.patch | 16 + .../patches/ganeti-disable-version-symlinks.patch | 136 +++++++ gnu/packages/patches/ganeti-drbd-compat.patch | 166 +++++++++ .../patches/ganeti-haskell-pythondir.patch | 66 ++++ gnu/packages/patches/ganeti-os-disk-size.patch | 17 + .../patches/ganeti-preserve-PYTHONPATH.patch | 21 ++ .../patches/ganeti-shepherd-master-failover.patch | 18 + gnu/packages/patches/ganeti-shepherd-support.patch | 87 +++++ gnu/packages/virtualization.scm | 395 +++++++++++++++++++++ 10 files changed, 930 insertions(+) create mode 100644 gnu/packages/patches/ganeti-deterministic-manual.patch create mode 100644 gnu/packages/patches/ganeti-disable-version-symlinks.patch create mode 100644 gnu/packages/patches/ganeti-drbd-compat.patch create mode 100644 gnu/packages/patches/ganeti-haskell-pythondir.patch create mode 100644 gnu/packages/patches/ganeti-os-disk-size.patch create mode 100644 gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch create mode 100644 gnu/packages/patches/ganeti-shepherd-master-failover.patch create mode 100644 gnu/packages/patches/ganeti-shepherd-support.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index f7c6036ee7..c36fa1ea5e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -947,6 +947,14 @@ dist_patch_DATA = \ %D%/packages/patches/fontconfig-hurd-path-max.patch \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ + %D%/packages/patches/ganeti-deterministic-manual.patch \ + %D%/packages/patches/ganeti-disable-version-symlinks.patch \ + %D%/packages/patches/ganeti-drbd-compat.patch \ + %D%/packages/patches/ganeti-haskell-pythondir.patch \ + %D%/packages/patches/ganeti-os-disk-size.patch \ + %D%/packages/patches/ganeti-preserve-PYTHONPATH.patch \ + %D%/packages/patches/ganeti-shepherd-master-failover.patch \ + %D%/packages/patches/ganeti-shepherd-support.patch \ %D%/packages/patches/gash-utils-ls-test.patch \ %D%/packages/patches/gawk-shell.patch \ %D%/packages/patches/gcc-arm-bug-71399.patch \ diff --git a/gnu/packages/patches/ganeti-deterministic-manual.patch b/gnu/packages/patches/ganeti-deterministic-manual.patch new file mode 100644 index 0000000000..2d90aa740e --- /dev/null +++ b/gnu/packages/patches/ganeti-deterministic-manual.patch @@ -0,0 +1,16 @@ +Sort the ecode list in the gnt-cluster manual for deterministic results. + +Submitted upstream: . + +diff --git a/lib/build/sphinx_ext.py b/lib/build/sphinx_ext.py +--- a/lib/build/sphinx_ext.py ++++ b/lib/build/sphinx_ext.py +@@ -108,7 +108,7 @@ CV_ECODES_DOC = "ecodes" + # pylint: disable=W0621 + CV_ECODES_DOC_LIST = [(name, doc) for (_, name, doc) in constants.CV_ALL_ECODES] + DOCUMENTED_CONSTANTS = { +- CV_ECODES_DOC: CV_ECODES_DOC_LIST, ++ CV_ECODES_DOC: sorted(CV_ECODES_DOC_LIST, key=lambda tup: tup[0]), + } + + diff --git a/gnu/packages/patches/ganeti-disable-version-symlinks.patch b/gnu/packages/patches/ganeti-disable-version-symlinks.patch new file mode 100644 index 0000000000..a5f347cfc6 --- /dev/null +++ b/gnu/packages/patches/ganeti-disable-version-symlinks.patch @@ -0,0 +1,136 @@ +This patch adds a new "--disable-version-links" configuration option +that allows installing to the standard GNU installation directories +instead of having to add symlinks in /etc/ganeti/{lib,share} that +points to the right $ganeti/{lib,share}/$version. Mainly to reduce +service complexity, and because Guix users can install as many versions +of Ganeti they can muster without resorting to such hacks. + +diff --git a/Makefile.am b/Makefile.am +--- a/Makefile.am ++++ b/Makefile.am +@@ -66,11 +66,16 @@ SHELL_ENV_INIT = autotools/shell-env-init + # so, if some currently architecture-independent executable is replaced by an + # architecture-dependent one (and hence has to go under $(versiondir)), add a link + # under $(versionedsharedir) but do not change the external links. ++# ++# As of Ganeti 3.0, it is possible to disable this behavior by passing ++# --disable-version-links, in which case the standard GNU installation ++# directories are used. + if USE_VERSION_FULL + DIRVERSION=$(VERSION_FULL) + else + DIRVERSION=$(VERSION_MAJOR).$(VERSION_MINOR) + endif ++if USE_VERSION_LINKS + versiondir = $(libdir)/ganeti/$(DIRVERSION) + defaultversiondir = $(libdir)/ganeti/default + versionedsharedir = $(prefix)/share/ganeti/$(DIRVERSION) +@@ -90,6 +95,18 @@ gntpythondir = $(versionedsharedir) + pkgpython_bindir = $(versionedsharedir) + gnt_python_sbindir = $(versionedsharedir) + tools_pythondir = $(versionedsharedir) ++else ++myexeclibdir = $(pkglibdir) ++pkgpython_rpc_stubdir = $(pkgpythondir)/rpc/stub ++gntpythondir = $(sbindir) ++pkgpython_bindir = $(pkglibdir) ++gnt_python_sbindir = $(sbindir) ++tools_pythondir = $(pkglibdir) ++versionedsharedir = $(pkglibdir) ++# This is a hack but works because the only user does $(versiondir)$(datadir). ++versiondir = ++endif !USE_VERSION_LINKS ++ + + clientdir = $(pkgpythondir)/client + cmdlibdir = $(pkgpythondir)/cmdlib +@@ -2356,6 +2373,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \ + -DVERSION_SUFFIX="$(VERSION_SUFFIX)" \ + -DVERSION_FULL="$(VERSION_FULL)" \ + -DDIRVERSION="$(DIRVERSION)" \ ++ -DUSE_VERSION_LINKS="$(USE_VERSION_LINKS)" \ + -DLOCALSTATEDIR="$(localstatedir)" \ + -DSYSCONFDIR="$(sysconfdir)" \ + -DSSH_CONFIG_DIR="$(SSH_CONFIG_DIR)" \ +@@ -2857,6 +2875,7 @@ install-exec-local: + @mkdir_p@ "$(DESTDIR)${localstatedir}/lib/ganeti" \ + "$(DESTDIR)${localstatedir}/log/ganeti" \ + "$(DESTDIR)${localstatedir}/run/ganeti" ++if USE_VERSION_LINKS + for dir in $(SYMLINK_TARGET_DIRS); do \ + @mkdir_p@ $(DESTDIR)$$dir; \ + done +@@ -2892,7 +2911,8 @@ install-exec-local: + if INSTALL_SYMLINKS + $(LN_S) -f $(versionedsharedir) $(DESTDIR)$(sysconfdir)/ganeti/share + $(LN_S) -f $(versiondir) $(DESTDIR)$(sysconfdir)/ganeti/lib +-endif ++endif INSTALL_SYMLINKS ++endif USE_VERSION_LINKS + + .PHONY: apidoc + if WANT_HSAPIDOC +diff --git a/configure.ac b/configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -29,6 +29,23 @@ AC_SUBST([BINDIR], $bindir) + AC_SUBST([SBINDIR], $sbindir) + AC_SUBST([MANDIR], $mandir) + ++# --enable-version-links ++AC_ARG_ENABLE([version-links], ++ [AS_HELP_STRING([--enable-version-links], ++ m4_normalize([install ganeti to version-specific ++ subdirectories to allow installing multiple versions ++ in parallel (default: enabled)]))], ++ [[if test "$enableval" != no; then ++ USE_VERSION_LINKS=True ++ else ++ USE_VERSION_LINKS=False ++ fi ++ ]], ++ [USE_VERSION_LINKS=True ++ ]) ++AC_SUBST(USE_VERSION_LINKS, $USE_VERSION_LINKS) ++AM_CONDITIONAL([USE_VERSION_LINKS], [test "$USE_VERSION_LINKS" = True]) ++ + # --enable-versionfull + AC_ARG_ENABLE([versionfull], + [AS_HELP_STRING([--enable-versionfull], +diff --git a/lib/bootstrap.py b/lib/bootstrap.py +--- a/lib/bootstrap.py ++++ b/lib/bootstrap.py +@@ -944,7 +944,7 @@ def SetupNodeDaemon(opts, cluster_name, node, ssh_port): + debug=opts.debug, verbose=opts.verbose, + use_cluster_key=True, ask_key=opts.ssh_key_check, + strict_host_check=opts.ssh_key_check, +- ensure_version=True) ++ ensure_version=constants.USE_VERSION_LINKS) + + _WaitForSshDaemon(node, ssh_port) + _WaitForNodeDaemon(node) +diff --git a/src/AutoConf.hs.in b/src/AutoConf.hs.in +--- a/src/AutoConf.hs.in ++++ b/src/AutoConf.hs.in +@@ -64,6 +64,9 @@ versionFull = "VERSION_FULL" + dirVersion :: String + dirVersion = "DIRVERSION" + ++useVersionLinks :: Bool ++useVersionLinks = USE_VERSION_LINKS ++ + localstatedir :: String + localstatedir = "LOCALSTATEDIR" + +diff --git a/src/Ganeti/Constants.hs b/src/Ganeti/Constants.hs +--- a/src/Ganeti/Constants.hs ++++ b/src/Ganeti/Constants.hs +@@ -164,5 +164,8 @@ versionRevision = AutoConf.versionRevision + dirVersion :: String + dirVersion = AutoConf.dirVersion + ++useVersionLinks :: Bool ++useVersionLinks = AutoConf.useVersionLinks ++ + osApiV10 :: Int + osApiV10 = 10 diff --git a/gnu/packages/patches/ganeti-drbd-compat.patch b/gnu/packages/patches/ganeti-drbd-compat.patch new file mode 100644 index 0000000000..32f46bc7ed --- /dev/null +++ b/gnu/packages/patches/ganeti-drbd-compat.patch @@ -0,0 +1,166 @@ +This patch adds support for newer versions of DRBD. + +Submitted upstream: . + +diff --git a/lib/storage/drbd.py b/lib/storage/drbd.py +--- a/lib/storage/drbd.py ++++ b/lib/storage/drbd.py +@@ -315,6 +315,13 @@ class DRBD8Dev(base.BlockDev): + """ + return self._show_info_cls.GetDevInfo(self._GetShowData(minor)) + ++ @staticmethod ++ def _NeedsLocalSyncerParams(): ++ # For DRBD >= 8.4, syncer init must be done after local, not in net. ++ info = DRBD8.GetProcInfo() ++ version = info.GetVersion() ++ return version["k_minor"] >= 4 ++ + def _MatchesLocal(self, info): + """Test if our local config matches with an existing device. + +@@ -397,6 +404,20 @@ class DRBD8Dev(base.BlockDev): + base.ThrowError("drbd%d: can't attach local disk: %s", + minor, result.output) + ++ def _WaitForMinorSyncParams(): ++ """Call _SetMinorSyncParams and raise RetryAgain on errors. ++ """ ++ if self._SetMinorSyncParams(minor, self.params): ++ raise utils.RetryAgain() ++ ++ if self._NeedsLocalSyncerParams(): ++ # Retry because disk config for DRBD resource may be still uninitialized. ++ try: ++ utils.Retry(_WaitForMinorSyncParams, 1.0, 5.0) ++ except utils.RetryTimeout as e: ++ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % ++ (minor, utils.CommaJoin(e.args[0]))) ++ + def _AssembleNet(self, minor, net_info, dual_pri=False, hmac=None, + secret=None): + """Configure the network part of the device. +@@ -432,21 +453,24 @@ class DRBD8Dev(base.BlockDev): + # sync speed only after setting up both sides can race with DRBD + # connecting, hence we set it here before telling DRBD anything + # about its peer. +- sync_errors = self._SetMinorSyncParams(minor, self.params) +- if sync_errors: +- base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % +- (minor, utils.CommaJoin(sync_errors))) ++ ++ if not self._NeedsLocalSyncerParams(): ++ sync_errors = self._SetMinorSyncParams(minor, self.params) ++ if sync_errors: ++ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % ++ (minor, utils.CommaJoin(sync_errors))) + + family = self._GetNetFamily(minor, lhost, rhost) + +- cmd = self._cmd_gen.GenNetInitCmd(minor, family, lhost, lport, ++ cmds = self._cmd_gen.GenNetInitCmds(minor, family, lhost, lport, + rhost, rport, protocol, + dual_pri, hmac, secret, self.params) + +- result = utils.RunCmd(cmd) +- if result.failed: +- base.ThrowError("drbd%d: can't setup network: %s - %s", +- minor, result.fail_reason, result.output) ++ for cmd in cmds: ++ result = utils.RunCmd(cmd) ++ if result.failed: ++ base.ThrowError("drbd%d: can't setup network: %s - %s", ++ minor, result.fail_reason, result.output) + + def _CheckNetworkConfig(): + info = self._GetShowInfo(minor) +@@ -463,19 +487,20 @@ class DRBD8Dev(base.BlockDev): + base.ThrowError("drbd%d: timeout while configuring network", minor) + + # Once the assembly is over, try to set the synchronization parameters +- try: +- # The minor may not have been set yet, requiring us to set it at least +- # temporarily +- old_minor = self.minor +- self._SetFromMinor(minor) +- sync_errors = self.SetSyncParams(self.params) +- if sync_errors: +- base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % +- (self.minor, utils.CommaJoin(sync_errors))) +- finally: +- # Undo the change, regardless of whether it will have to be done again +- # soon +- self._SetFromMinor(old_minor) ++ if not self._NeedsLocalSyncerParams(): ++ try: ++ # The minor may not have been set yet, requiring us to set it at least ++ # temporarily ++ old_minor = self.minor ++ self._SetFromMinor(minor) ++ sync_errors = self.SetSyncParams(self.params) ++ if sync_errors: ++ base.ThrowError("drbd%d: can't set the synchronization parameters: %s" % ++ (self.minor, utils.CommaJoin(sync_errors))) ++ finally: ++ # Undo the change, regardless of whether it will have to be done again ++ # soon ++ self._SetFromMinor(old_minor) + + @staticmethod + def _GetNetFamily(minor, lhost, rhost): +diff --git a/lib/storage/drbd_cmdgen.py b/lib/storage/drbd_cmdgen.py +--- a/lib/storage/drbd_cmdgen.py ++++ b/lib/storage/drbd_cmdgen.py +@@ -56,7 +56,7 @@ class BaseDRBDCmdGenerator(object): + def GenLocalInitCmds(self, minor, data_dev, meta_dev, size_mb, params): + raise NotImplementedError + +- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, ++ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, + dual_pri, hmac, secret, params): + raise NotImplementedError + +@@ -138,7 +138,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator): + + return [args] + +- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, ++ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, + dual_pri, hmac, secret, params): + args = ["drbdsetup", self._DevPath(minor), "net", + "%s:%s:%s" % (family, lhost, lport), +@@ -155,7 +155,7 @@ class DRBD83CmdGenerator(BaseDRBDCmdGenerator): + if params[constants.LDP_NET_CUSTOM]: + args.extend(shlex.split(params[constants.LDP_NET_CUSTOM])) + +- return args ++ return [args] + + def GenSyncParamsCmd(self, minor, params): + args = ["drbdsetup", self._DevPath(minor), "syncer"] +@@ -345,8 +345,14 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator): + + return cmds + +- def GenNetInitCmd(self, minor, family, lhost, lport, rhost, rport, protocol, ++ def GenNetInitCmds(self, minor, family, lhost, lport, rhost, rport, protocol, + dual_pri, hmac, secret, params): ++ cmds = [] ++ ++ cmds.append(["drbdsetup", "new-resource", self._GetResource(minor)]) ++ cmds.append(["drbdsetup", "new-minor", self._GetResource(minor), ++ str(minor), "0"]) ++ + args = ["drbdsetup", "connect", self._GetResource(minor), + "%s:%s:%s" % (family, lhost, lport), + "%s:%s:%s" % (family, rhost, rport), +@@ -362,7 +368,8 @@ class DRBD84CmdGenerator(BaseDRBDCmdGenerator): + if params[constants.LDP_NET_CUSTOM]: + args.extend(shlex.split(params[constants.LDP_NET_CUSTOM])) + +- return args ++ cmds.append(args) ++ return cmds + + def GenSyncParamsCmd(self, minor, params): + args = ["drbdsetup", "disk-options", minor] diff --git a/gnu/packages/patches/ganeti-haskell-pythondir.patch b/gnu/packages/patches/ganeti-haskell-pythondir.patch new file mode 100644 index 0000000000..fa77771839 --- /dev/null +++ b/gnu/packages/patches/ganeti-haskell-pythondir.patch @@ -0,0 +1,66 @@ +This patch allows the Haskell daemons to locate Python libraries +installed to a non-standard pythondir. It is necessary because Guix +does not use versionedsharedir (see related patch that disables it). + +diff --git a/Makefile.am b/Makefile.am +--- a/Makefile.am ++++ b/Makefile.am +@@ -83,6 +83,7 @@ myexeclibdir = $(pkglibdir) + bindir = $(versiondir)/$(BINDIR) + sbindir = $(versiondir)$(SBINDIR) + mandir = $(versionedsharedir)/root$(MANDIR) ++pythondir = $(versionedsharedir) + pkgpythondir = $(versionedsharedir)/ganeti + pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub + gntpythondir = $(versionedsharedir) +@@ -2386,6 +2387,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \ + -DPKGLIBDIR="$(libdir)/ganeti" \ + -DSHAREDIR="$(prefix)/share/ganeti" \ + -DVERSIONEDSHAREDIR="$(versionedsharedir)" \ ++ -DPYTHONDIR="$(pythondir)" \ + -DDRBD_BARRIERS="$(DRBD_BARRIERS)" \ + -DDRBD_NO_META_FLUSH="$(DRBD_NO_META_FLUSH)" \ + -DSYSLOG_USAGE="$(SYSLOG_USAGE)" \ +diff --git a/src/AutoConf.hs.in b/src/AutoConf.hs.in +--- a/src/AutoConf.hs.in ++++ b/src/AutoConf.hs.in +@@ -157,6 +157,9 @@ sharedir = "SHAREDIR" + versionedsharedir :: String + versionedsharedir = "VERSIONEDSHAREDIR" + ++pythondir :: String ++pythondir = "PYTHONDIR" ++ + drbdBarriers :: String + drbdBarriers = "DRBD_BARRIERS" + +diff --git a/src/Ganeti/Path.hs b/src/Ganeti/Path.hs +--- a/src/Ganeti/Path.hs ++++ b/src/Ganeti/Path.hs +@@ -188,5 +188,5 @@ getInstReasonFilename instName = instanceReasonDir `pjoin` instName + + -- | The path to the Python executable for starting jobs. + jqueueExecutorPy :: IO FilePath +-jqueueExecutorPy = return $ versionedsharedir +- "ganeti" "jqueue" "exec.py" ++jqueueExecutorPy = return $ pythondir ++ "ganeti" "jqueue" "exec.py" +diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs +--- a/src/Ganeti/Query/Exec.hs ++++ b/src/Ganeti/Query/Exec.hs +@@ -99,12 +99,12 @@ spawnJobProcess jid = withErrorLogAt CRITICAL (show jid) $ + do + use_debug <- isDebugMode + env_ <- (M.toList . M.insert "GNT_DEBUG" (if use_debug then "1" else "0") +- . M.insert "PYTHONPATH" AC.versionedsharedir ++ . M.insert "PYTHONPATH" AC.pythondir + . M.fromList) + `liftM` getEnvironment + execPy <- P.jqueueExecutorPy + logDebug $ "Executing " ++ AC.pythonPath ++ " " ++ execPy +- ++ " with PYTHONPATH=" ++ AC.versionedsharedir ++ ++ " with PYTHONPATH=" ++ AC.pythondir + + (master, child) <- pipeClient connectConfig + let (rh, wh) = clientToHandle child + diff --git a/gnu/packages/patches/ganeti-os-disk-size.patch b/gnu/packages/patches/ganeti-os-disk-size.patch new file mode 100644 index 0000000000..16b1d7615c --- /dev/null +++ b/gnu/packages/patches/ganeti-os-disk-size.patch @@ -0,0 +1,17 @@ +This exposes information about disk sizes to OS install scripts. instance-guix +uses this if available to determine the size of the VM image. + +Submitted upstream: +https://github.com/ganeti/ganeti/pull/1503 + +diff --git a/lib/backend.py b/lib/backend.py +--- a/lib/backend.py ++++ b/lib/backend.py +@@ -4305,6 +4305,7 @@ def OSEnvironment(instance, inst_os, debug=0): + uri = _CalculateDeviceURI(instance, disk, real_disk) + result["DISK_%d_ACCESS" % idx] = disk.mode + result["DISK_%d_UUID" % idx] = disk.uuid ++ result["DISK_%d_SIZE" % idx] = str(disk.size) + if real_disk.dev_path: + result["DISK_%d_PATH" % idx] = real_disk.dev_path + if uri: diff --git a/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch b/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch new file mode 100644 index 0000000000..1358e30633 --- /dev/null +++ b/gnu/packages/patches/ganeti-preserve-PYTHONPATH.patch @@ -0,0 +1,21 @@ +Do not override PYTHONPATH when calling Python code from the Haskell +daemons. This is necessary because the Python library dependencies are +only available through PYTHONPATH. + +diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs +--- a/src/Ganeti/Query/Exec.hs ++++ b/src/Ganeti/Query/Exec.hs +@@ -99,12 +99,10 @@ spawnJobProcess jid = withErrorLogAt CRITICAL (show jid) $ + do + use_debug <- isDebugMode + env_ <- (M.toList . M.insert "GNT_DEBUG" (if use_debug then "1" else "0") +- . M.insert "PYTHONPATH" AC.pythondir + . M.fromList) + `liftM` getEnvironment + execPy <- P.jqueueExecutorPy + logDebug $ "Executing " ++ AC.pythonPath ++ " " ++ execPy +- ++ " with PYTHONPATH=" ++ AC.pythondir + + (master, child) <- pipeClient connectConfig + let (rh, wh) = clientToHandle child + diff --git a/gnu/packages/patches/ganeti-shepherd-master-failover.patch b/gnu/packages/patches/ganeti-shepherd-master-failover.patch new file mode 100644 index 0000000000..36a7918998 --- /dev/null +++ b/gnu/packages/patches/ganeti-shepherd-master-failover.patch @@ -0,0 +1,18 @@ +By default, master-failover will call "herd start ganeti-wconfd" with +extra arguments such as --force-node. That does not work with the +Shepherd, so the Guix service has a "force-start" action for this purpose. + +diff --git a/lib/bootstrap.py b/lib/bootstrap.py +--- a/lib/bootstrap.py ++++ b/lib/bootstrap.py +@@ -1011,9 +1011,7 @@ def MasterFailover(no_voting=False): + + try: + # Forcefully start WConfd so that we can access the configuration +- result = utils.RunCmd([pathutils.DAEMON_UTIL, +- "start", constants.WCONFD, "--force-node", +- "--no-voting", "--yes-do-it"]) ++ result = utils.RunCmd(["herd", "force-start", constants.WCONFD]) + if result.failed: + raise errors.OpPrereqError("Could not start the configuration daemon," + " command %s had exitcode %s and error %s" % diff --git a/gnu/packages/patches/ganeti-shepherd-support.patch b/gnu/packages/patches/ganeti-shepherd-support.patch new file mode 100644 index 0000000000..f750604344 --- /dev/null +++ b/gnu/packages/patches/ganeti-shepherd-support.patch @@ -0,0 +1,87 @@ +Ganeti uses an internal tool to start/stop daemons during init and +upgrade. This patch makes the tool use native Shepherd facilities. + +diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in +--- a/daemons/daemon-util.in ++++ b/daemons/daemon-util.in +@@ -184,6 +184,21 @@ use_systemctl() { + return 1 + } + ++# Checks if we should use the Shepherd to start/stop daemons ++use_shepherd() { ++ # Is Shepherd running as PID 1? ++ ps --no-headers -p 1 -o cmd | grep -q shepherd || return 1 ++ ++ type -p herd >/dev/null || return 1 ++ ++ # Does Shepherd know about Ganeti at all? ++ if herd status | grep -q ganeti; then ++ return 0 ++ fi ++ ++ return 1 ++} ++ + # Prints path to PID file for a daemon. + daemon_pidfile() { + if [[ "$#" -lt 1 ]]; then +@@ -261,6 +276,13 @@ check() { + else + return 1 + fi ++ elif use_shepherd; then ++ activestate="$(herd status ${name})" ++ if echo $activestate | grep -q Running ; then ++ return 0 ++ else ++ return 1 ++ fi + elif type -p start-stop-daemon >/dev/null; then + start-stop-daemon --stop --signal 0 --quiet \ + --pidfile $pidfile --name "$name" +@@ -291,6 +313,20 @@ start() { + return $? + fi + ++ if use_shepherd; then ++ if herd status "$name" | grep -q "disabled"; then ++ # The Shepherd will disable a service that has stopped, even if it exits ++ # gracefully. Thus, we must re-enable it in case of a master failover. ++ herd enable "${name}" ++ fi ++ # Note: unlike systemd, which happily starts a service and returns success ++ # even if the daemon immediately exits, the Shepherd actually waits for it ++ # to come up. Thus, ignore the exit status from 'herd start' in case of ++ # master daemons running on the wrong node, or ganeti-kvmd disabled, etc. ++ herd start "${name}" ++ return 0 ++ fi ++ + # Read $_ARGS and $EXTRA__ARGS + eval local args="\"\$${ucname}_ARGS \$EXTRA_${ucname}_ARGS\"" + +@@ -336,6 +372,13 @@ stop() { + + if use_systemctl; then + systemctl stop "${name}.service" ++ elif use_shepherd; then ++ if herd status | grep -q "$name"; then ++ herd stop "$name" ++ else ++ # Do not raise an error if the service has not been enabled. ++ return 0 ++ fi + elif type -p start-stop-daemon >/dev/null; then + start-stop-daemon --stop --quiet --oknodo --retry 30 \ + --pidfile $pidfile --name "$name" +@@ -352,6 +395,9 @@ check_and_start() { + if use_systemctl; then + echo "${name} supervised by systemd but not running, will not restart." + return 1 ++ elif use_shepherd; then ++ echo "${name} supervised by shepherd but not running, will not restart." ++ return 1 + fi + + start $name diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm index f4df76fec9..d4ef9cc3fd 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -38,6 +38,7 @@ #:use-module (gnu packages attr) #:use-module (gnu packages autotools) #:use-module (gnu packages backup) + #:use-module (gnu packages base) #:use-module (gnu packages bison) #:use-module (gnu packages check) #:use-module (gnu packages cmake) @@ -60,11 +61,19 @@ #:use-module (gnu packages gnome) #:use-module (gnu packages gnupg) #:use-module (gnu packages golang) + #:use-module (gnu packages graphviz) #:use-module (gnu packages gtk) + #:use-module (gnu packages haskell) + #:use-module (gnu packages haskell-apps) + #:use-module (gnu packages haskell-check) + #:use-module (gnu packages haskell-crypto) + #:use-module (gnu packages haskell-web) + #:use-module (gnu packages haskell-xyz) #:use-module (gnu packages image) #:use-module (gnu packages libbsd) #:use-module (gnu packages libusb) #:use-module (gnu packages linux) + #:use-module (gnu packages m4) #:use-module (gnu packages ncurses) #:use-module (gnu packages nettle) #:use-module (gnu packages networking) @@ -75,6 +84,7 @@ #:use-module (gnu packages polkit) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) + #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages pulseaudio) @@ -82,6 +92,7 @@ #:use-module (gnu packages sdl) #:use-module (gnu packages sphinx) #:use-module (gnu packages spice) + #:use-module (gnu packages ssh) #:use-module (gnu packages texinfo) #:use-module (gnu packages textutils) #:use-module (gnu packages tls) @@ -349,6 +360,390 @@ server and embedded PowerPC, and S390 guests.") "usbredir" "libdrm" "libepoxy" "pulseaudio" "vde2" "libcacard"))))) +(define (system->qemu-target system) + (cond + ((string-prefix? "i686" system) + "qemu-system-i386") + ((string-prefix? "arm" system) + "qemu-system-arm") + (else + (string-append "qemu-system-" (match (string-split system #\-) + ((arch kernel) arch) + (_ system)))))) + +(define-public ganeti + (package + (name "ganeti") + ;; Note: we use a pre-release for Python 3 compatibility as well as many + ;; other fixes. + (version "3.0.0beta1-24-g024cc9fa2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ganeti/ganeti") + (commit (string-append "v" version)))) + (sha256 + (base32 "1ll34qd2mifni3bhg7cnir3xfnkafig8ch33qndqwrsby0y5ssia")) + (file-name (git-file-name name version)) + (patches (search-patches "ganeti-shepherd-support.patch" + "ganeti-shepherd-master-failover.patch" + "ganeti-deterministic-manual.patch" + "ganeti-drbd-compat.patch" + "ganeti-os-disk-size.patch" + "ganeti-haskell-pythondir.patch" + "ganeti-disable-version-symlinks.patch" + "ganeti-preserve-PYTHONPATH.patch")))) + (build-system gnu-build-system) + (arguments + `(#:imported-modules (,@%gnu-build-system-modules + (guix build haskell-build-system) + (guix build python-build-system)) + #:modules (,@%gnu-build-system-modules + ((guix build haskell-build-system) #:prefix haskell:) + ((guix build python-build-system) #:select (python-version)) + (ice-9 rdelim)) + + ;; The default test target includes a lot of checks that are only really + ;; relevant for developers such as NEWS file checking, line lengths, etc. + ;; We are only interested in the "py-tests" and "hs-tests" targets: this + ;; is the closest we've got even though it includes a little more. + #:test-target "check-TESTS" + + #:configure-flags + (list "--localstatedir=/var" + "--sharedstatedir=/var" + "--sysconfdir=/etc" + "--enable-haskell-tests" + + ;; By default, the build system installs everything to versioned + ;; directories such as $libdir/3.0 and relies on a $libdir/default + ;; symlink pointed from /etc/ganeti/{lib,share} to actually function. + ;; This is done to accommodate installing multiple versions in + ;; parallel, but is of little use to us as Guix users can just + ;; roll back and forth. Thus, disable it for simplicity. + "--disable-version-links" + + ;; Ganeti can optionally take control over SSH host keys and + ;; distribute them to nodes as they are added, and also rotate keys + ;; with 'gnt-cluster renew-crypto --new-ssh-keys'. Thus it needs to + ;; know how to restart the SSH daemon. + "--with-sshd-restart-command='herd restart ssh-daemon'" + + ;; Look for OS definitions in this directory by default. It can + ;; be changed in the cluster configuration. + "--with-os-search-path=/run/current-system/profile/share/ganeti/os" + + ;; The default QEMU executable to use. We don't use the package + ;; here because this entry is stored in the cluster configuration. + (string-append "--with-kvm-path=/run/current-system/profile/bin/" + ,(system->qemu-target (%current-system)))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'create-vcs-version + (lambda _ + ;; If we are building from a git checkout, we need to create a + ;; 'vcs-version' file manually because the build system does + ;; not have access to the git repository information. + (unless (file-exists? "vcs-version") + (call-with-output-file "vcs-version" + (lambda (port) + (format port "v~a~%" ,version)))) + #t)) + (add-after 'unpack 'patch-absolute-file-names + (lambda _ + (substitute* '("lib/utils/process.py" + "lib/utils/text.py" + "src/Ganeti/Constants.hs" + "src/Ganeti/HTools/CLI.hs" + "test/py/ganeti.config_unittest.py" + "test/py/ganeti.hooks_unittest.py" + "test/py/ganeti.utils.process_unittest.py" + "test/py/ganeti.utils.text_unittest.py" + "test/py/ganeti.utils.wrapper_unittest.py") + (("/bin/sh") (which "sh")) + (("/bin/bash") (which "bash")) + (("/usr/bin/env") (which "env")) + (("/bin/true") (which "true"))) + + ;; This script is called by the node daemon at startup to perform + ;; sanity checks on the cluster IP addresses, and it is also used + ;; in a master-failover scenario. Add absolute references to + ;; avoid propagating these executables. + (substitute* "tools/master-ip-setup" + (("arping") (which "arping")) + (("ndisc6") (which "ndisc6")) + (("fping") (which "fping")) + (("grep") (which "grep")) + (("ip addr") (string-append (which "ip") " addr"))) + #t)) + (add-after 'unpack 'override-builtin-PATH + (lambda _ + ;; Ganeti runs OS install scripts and similar with a built-in + ;; hard coded PATH. Patch so it works on Guix System. + (substitute* "src/Ganeti/Constants.hs" + (("/sbin:/bin:/usr/sbin:/usr/bin") + "/run/setuid-programs:/run/current-system/profile/sbin:\ +/run/current-system/profile/bin")) + #t)) + (add-after 'bootstrap 'patch-sphinx-version-detection + (lambda _ + ;; The build system runs 'sphinx-build --version' to verify that + ;; the Sphinx is recent enough, but does not expect the + ;; .sphinx-build-real executable name created by the Sphinx wrapper. + (substitute* "configure" + (("\\$SPHINX --version 2>&1") + "$SPHINX --version 2>&1 | sed 's/.sphinx-build-real/sphinx-build/g'")) + #t)) + + ;; The build system invokes Cabal and GHC, which do not work with + ;; GHC_PACKAGE_PATH: . + ;; Tweak the build system to do roughly what haskell-build-system does. + (add-before 'configure 'configure-haskell + (assoc-ref haskell:%standard-phases 'setup-compiler)) + (add-after 'configure 'do-not-use-GHC_PACKAGE_PATH + (lambda _ + (unsetenv "GHC_PACKAGE_PATH") + (substitute* "Makefile" + (("\\$\\(CABAL\\)") + "$(CABAL) --package-db=../package.conf.d") + (("\\$\\(GHC\\)") + "$(GHC) -package-db=../package.conf.d")) + #t)) + + (add-after 'configure 'fix-installation-directories + (lambda _ + (substitute* "Makefile" + ;; Do not attempt to create /var during install. + (("\\$\\(DESTDIR\\)\\$\\{localstatedir\\}") + "$(DESTDIR)${prefix}${localstatedir}") + ;; Similarly, do not attempt to install the sample ifup scripts + ;; to /etc/ganeti. + (("\\$\\(DESTDIR\\)\\$\\(ifupdir\\)") + "$(DESTDIR)${prefix}$(ifupdir)")) + #t)) + (add-before 'build 'adjust-tests + (lambda _ + ;; Disable tests that can not run. Do it early to prevent + ;; touching the Makefile later and triggering a needless rebuild. + (substitute* "Makefile" + ;; These tests expect the presence of a 'root' user (via + ;; ganeti/runtime.py), which fails in the build environment. + (("test/py/ganeti\\.asyncnotifier_unittest\\.py") "") + (("test/py/ganeti\\.backend_unittest\\.py") "") + (("test/py/ganeti\\.daemon_unittest\\.py") "") + (("test/py/ganeti\\.tools\\.ensure_dirs_unittest\\.py") "") + (("test/py/ganeti\\.utils\\.io_unittest-runasroot\\.py") "") + ;; Disable the bash_completion test, as it requires the full + ;; bash instead of bash-minimal. + (("test/py/bash_completion\\.bash") + "") + ;; This test requires networking. + (("test/py/import-export_unittest\\.bash") + "")) + + ;; Many of the Makefile targets reset PYTHONPATH before running + ;; the Python interpreter, which does not work very well for us. + (substitute* "Makefile" + (("PYTHONPATH=") + (string-append "PYTHONPATH=" (getenv "PYTHONPATH") ":"))) + #t)) + (add-after 'build 'build-bash-completions + (lambda _ + (let ((orig-pythonpath (getenv "PYTHONPATH"))) + (setenv "PYTHONPATH" (string-append ".:" orig-pythonpath)) + (invoke "./autotools/build-bash-completion") + (setenv "PYTHONPATH" orig-pythonpath) + #t))) + (add-before 'check 'pre-check + (lambda* (#:key inputs #:allow-other-keys) + ;; Set TZDIR so that time zones are found. + (setenv "TZDIR" (string-append (assoc-ref inputs "tzdata") + "/share/zoneinfo")) + + ;; This test checks whether PYTHONPATH is untouched, and extends + ;; it to include test directories if so. Add an else branch for + ;; our modified PYTHONPATH, in order to prevent a confusing test + ;; failure where expired certificates are not cleaned because + ;; check-cert-expired is silently crashing. + (substitute* "test/py/ganeti-cleaner_unittest.bash" + (("then export PYTHONPATH=(.*)" all testpath) + (string-append all "else export PYTHONPATH=" + (getenv "PYTHONPATH") ":" testpath "\n"))) + + (substitute* "test/py/ganeti.utils.process_unittest.py" + ;; This test attempts to run an executable with + ;; RunCmd(..., reset_env=True), which fails because the default + ;; PATH from Constants.hs does not exist in the build container. + ((".*def testResetEnv.*" all) + (string-append " @unittest.skipIf(True, " + "\"cannot reset env in the build container\")\n" + all)) + + ;; XXX: Somehow this test fails in the build container, but + ;; works in 'guix environment -C', even without /bin/sh? + ((".*def testPidFile.*" all) + (string-append " @unittest.skipIf(True, " + "\"testPidFile fails in the build container\")\n" + all))) + + ;; XXX: Why are these links not added automatically. + (with-directory-excursion "test/hs" + (for-each (lambda (file) + (symlink "../../src/htools" file)) + '("hspace" "hscan" "hinfo" "hbal" "hroller" + "hcheck" "hail" "hsqueeze"))) + #t)) + (add-after 'install 'install-bash-completions + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (compdir (string-append out "/etc/bash_completion.d"))) + (mkdir-p compdir) + (copy-file "doc/examples/bash_completion" + (string-append compdir "/ganeti")) + ;; The one file contains completions for many different + ;; executables. Create symlinks for found completions. + (with-directory-excursion compdir + (for-each + (lambda (prog) (symlink "ganeti" prog)) + (call-with-input-file "ganeti" + (lambda (port) + (let loop ((line (read-line port)) + (progs '())) + (if (eof-object? line) + progs + (if (string-prefix? "complete" line) + (loop (read-line port) + ;; Extract "prog" from lines of the form: + ;; "complete -F _prog -o filenames prog". + ;; Note that 'burnin' is listed with the + ;; absolute file name, which is why we + ;; run everything through 'basename'. + (cons (basename (car (reverse (string-split + line #\ )))) + progs)) + (loop (read-line port) progs)))))))) + #t))) + ;; Wrap all executables with PYTHONPATH. We can't borrow the phase + ;; from python-build-system because we also need to wrap the scripts + ;; in $out/lib/ganeti such as "node-daemon-setup". + (add-after 'install 'wrap + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (sbin (string-append out "/sbin")) + (lib (string-append out "/lib")) + (python (assoc-ref inputs "python")) + (major+minor (python-version python)) + (PYTHONPATH (string-append lib "/python" major+minor + "/site-packages:" + (getenv "PYTHONPATH")))) + (define (shell-script? file) + (call-with-ascii-input-file file + (lambda (port) + (let ((shebang (false-if-exception (read-line port)))) + (and shebang + (string-prefix? "#!" shebang) + (or (string-contains shebang "/bin/bash") + (string-contains shebang "/bin/sh"))))))) + + (define (wrap? file) + ;; Do not wrap shell scripts because some are meant to be + ;; sourced, which breaks if they are wrapped. We do wrap + ;; the Haskell executables because some call out to Python + ;; directly. + (and (executable-file? file) + (not (symbolic-link? file)) + (not (shell-script? file)))) + + (for-each (lambda (file) + (wrap-program file + `("PYTHONPATH" ":" prefix (,PYTHONPATH)))) + (filter wrap? + (append (find-files (string-append lib "/ganeti")) + (find-files sbin)))) + #t)))))) + (native-inputs + `(("haskell" ,ghc) + ("cabal" ,cabal-install) + ("m4" ,m4) + + ;; These inputs are necessary to bootstrap the package, because we + ;; have patched the build system. + ("autoconf" ,autoconf) + ("automake" ,automake) + + ;; For the documentation. + ("python-docutils" ,python-docutils) + ("sphinx" ,python-sphinx) + ("pandoc" ,ghc-pandoc) + ("dot" ,graphviz) + + ;; Test dependencies. + ("fakeroot" ,fakeroot) + ("ghc-temporary" ,ghc-temporary) + ("ghc-test-framework" ,ghc-test-framework) + ("ghc-test-framework-hunit" ,ghc-test-framework-hunit) + ("ghc-test-framework-quickcheck2" ,ghc-test-framework-quickcheck2) + ("python-mock" ,python-mock) + ("python-pyyaml" ,python-pyyaml) + ("openssh" ,openssh) + ("procps" ,procps) + ("shelltestrunner" ,shelltestrunner) + ("tzdata" ,tzdata-for-tests))) + (inputs + `(("arping" ,iputils) ;must be the iputils version + ("curl" ,curl) + ("fping" ,fping) + ("iproute2" ,iproute) + ("ndisc6" ,ndisc6) + ("socat" ,socat) + ("qemu" ,qemu-minimal) ;for qemu-img + ("ghc-attoparsec" ,ghc-attoparsec) + ("ghc-base64-bytestring" ,ghc-base64-bytestring) + ("ghc-cryptonite" ,ghc-cryptonite) + ("ghc-curl" ,ghc-curl) + ("ghc-hinotify" ,ghc-hinotify) + ("ghc-hslogger" ,ghc-hslogger) + ("ghc-json" ,ghc-json) + ("ghc-lens" ,ghc-lens) + ("ghc-lifted-base" ,ghc-lifted-base) + ("ghc-network" ,ghc-network) + ("ghc-old-time" ,ghc-old-time) + ("ghc-psqueue" ,ghc-psqueue) + ("ghc-regex-pcre" ,ghc-regex-pcre) + ("ghc-utf8-string" ,ghc-utf8-string) + ("ghc-zlib" ,ghc-zlib) + + ;; For the optional metadata daemon. + ("ghc-snap-core" ,ghc-snap-core) + ("ghc-snap-server" ,ghc-snap-server) + + ("python" ,python) + ("python-pyopenssl" ,python-pyopenssl) + ("python-simplejson" ,python-simplejson) + ("python-pyparsing" ,python-pyparsing) + ("python-pyinotify" ,python-pyinotify) + ("python-pycurl" ,python-pycurl) + ("python-bitarray" ,python-bitarray) + ("python-paramiko" ,python-paramiko) + ("python-psutil" ,python-psutil))) + (home-page "http://www.ganeti.org/") + (synopsis "Cluster-based virtual machine management system") + (description + "Ganeti is a virtual machine management tool built on top of existing +virtualization technologies such as Xen or KVM. Ganeti controls: + +@itemize @bullet +@item Disk creation management; +@item Operating system installation for instances (in co-operation with +OS-specific install scripts); and +@item Startup, shutdown, and failover between physical systems. +@end itemize + +Ganeti is designed to facilitate cluster management of virtual servers and +to provide fast and simple recovery after physical failures, using +commodity hardware.") + (license license:bsd-2))) + (define-public libosinfo (package (name "libosinfo") -- cgit v1.2.3 From ba7a63da4822d53298d64a31e3dd55bc60bad62a Mon Sep 17 00:00:00 2001 From: Diego Nicola Barbato Date: Fri, 17 Jul 2020 01:18:00 +0200 Subject: gnu: emacs-exwm: Fix fullscreen states. * gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/emacs-xyz.scm (emacs-exwm)[source]: Use it. Signed-off-by: Nicolas Goaziou --- gnu/local.mk | 1 + gnu/packages/emacs-xyz.scm | 7 +++- .../patches/emacs-exwm-fix-fullscreen-states.patch | 39 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 7f4ff1f695..a50048e749 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -907,6 +907,7 @@ dist_patch_DATA = \ %D%/packages/patches/elm-compiler-fix-map-key.patch \ %D%/packages/patches/emacs27-exec-path.patch \ %D%/packages/patches/emacs-exec-path.patch \ + %D%/packages/patches/emacs-exwm-fix-fullscreen-states.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 537638bd36..c3f9d768f9 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -10900,7 +10900,12 @@ It should enable you to implement low-level X11 applications.") (uri (string-append "https://elpa.gnu.org/packages/" "exwm-" version ".tar")) (sha256 - (base32 "0lj1a3cmbpf4h6x8k6x8cdm1qb51ca6filydnvi5zcda8zpl060s")))) + (base32 "0lj1a3cmbpf4h6x8k6x8cdm1qb51ca6filydnvi5zcda8zpl060s")) + (patches + ;; Patch fixing fullscreen view. Applied upstream as + ;; edb930005b0ba83051ca8a59b493e9a3c8ef580a. It can be removed in + ;; next release. + (search-patches "emacs-exwm-fix-fullscreen-states.patch")))) (build-system emacs-build-system) (propagated-inputs `(("emacs-xelb" ,emacs-xelb))) diff --git a/gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch b/gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch new file mode 100644 index 0000000000..6d31021f67 --- /dev/null +++ b/gnu/packages/patches/emacs-exwm-fix-fullscreen-states.patch @@ -0,0 +1,39 @@ +From edb930005b0ba83051ca8a59b493e9a3c8ef580a Mon Sep 17 00:00:00 2001 +From: Chris Feng +Date: Sun, 14 Jun 2020 00:00:00 +0000 +Subject: [PATCH] Fix fullscreen states + +* exwm-layout.el (exwm-layout-set-fullscreen, +exwm-layout-unset-fullscreen): Use `exwm--id' for interactive use. +(exwm-layout-unset-fullscreen): Mandatorily clear fullscreen states. +--- + exwm-layout.el | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/exwm-layout.el b/exwm-layout.el +index 170c2be..79d0c95 100644 +--- a/exwm-layout.el ++++ b/exwm-layout.el +@@ -205,7 +205,7 @@ + :border-width 0 + :stack-mode xcb:StackMode:Above)) + (cl-pushnew xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state) +- (exwm-layout--set-ewmh-state id) ++ (exwm-layout--set-ewmh-state exwm--id) + (xcb:flush exwm--connection) + (set-window-dedicated-p (get-buffer-window) t) + (exwm-input--release-keyboard exwm--id))) +@@ -233,7 +233,9 @@ + (let ((window (get-buffer-window nil t))) + (when window + (exwm-layout--show exwm--id window)))) +- (exwm-layout--set-ewmh-state id) ++ (setq exwm--ewmh-state ++ (delq xcb:Atom:_NET_WM_STATE_FULLSCREEN exwm--ewmh-state)) ++ (exwm-layout--set-ewmh-state exwm--id) + (xcb:flush exwm--connection) + (set-window-dedicated-p (get-buffer-window) nil) + (when (eq 'line-mode exwm--selected-input-mode) +-- +2.26.2 + -- cgit v1.2.3 From c3951015d79ce7410fbd66d889acc88be9192d32 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 27 Jun 2020 17:25:52 +0200 Subject: gnu: Add maven-enforcer-api. * gnu/packages/maven.scm (maven-enforcer-api): New variable. * gnu/packages/patches/maven-enforcer-api-fix-old-dependencies.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/maven.scm | 50 ++++++ .../maven-enforcer-api-fix-old-dependencies.patch | 177 +++++++++++++++++++++ 3 files changed, 228 insertions(+) create mode 100644 gnu/packages/patches/maven-enforcer-api-fix-old-dependencies.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 67756186b5..b174cdeaf5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1279,6 +1279,7 @@ dist_patch_DATA = \ %D%/packages/patches/mars-install.patch \ %D%/packages/patches/mars-sfml-2.3.patch \ %D%/packages/patches/maxima-defsystem-mkdir.patch \ + %D%/packages/patches/maven-enforcer-api-fix-old-dependencies.patch \ %D%/packages/patches/maven-generate-component-xml.patch \ %D%/packages/patches/maven-generate-javax-inject-named.patch \ %D%/packages/patches/mcrypt-CVE-2012-4409.patch \ diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm index bca499d87d..fb0cb9eac4 100644 --- a/gnu/packages/maven.scm +++ b/gnu/packages/maven.scm @@ -2655,3 +2655,53 @@ Maven project dependencies.") (description "This package provides a tree-based API for resolution of Maven project dependencies.") (license license:asl2.0))) + +(define-public maven-enforcer-api + (package + (name "maven-enforcer-api") + (version "3.0.0-M3") + (source (origin + (method url-fetch) + (uri (string-append "mirror://apache/maven/enforcer/" + "enforcer-" version "-source-release.zip")) + (sha256 + (base32 + "014cwj0dqa69nnlzcin8pk9wsjmmg71vsbcpb16cibcjpm6h9wjg")) + (patches + (search-patches "maven-enforcer-api-fix-old-dependencies.patch")))) + (build-system ant-build-system) + (arguments + `(#:jar-name "maven-enforcer-api.jar" + #:source-dir "enforcer-api/src/main/java" + #:tests? #f; no tests + #:phases + (modify-phases %standard-phases + (replace 'install + (install-from-pom "enforcer-api/pom.xml"))))) + (propagated-inputs + `(("maven-plugin-api" ,maven-plugin-api) + ("java-plexus-container-default" ,java-plexus-container-default) + ("java-jsr305" ,java-jsr305) + ("maven-enforcer-parent-pom" ,maven-enforcer-parent-pom))) + (native-inputs + `(("unzip" ,unzip))) + (home-page "https://maven.apache.org/shared/maven-dependency-tree") + (synopsis "Tree-based API for resolution of Maven project dependencies") + (description "This package provides a tree-based API for resolution of +Maven project dependencies.") + (license license:asl2.0))) + +(define maven-enforcer-parent-pom + (package + (inherit maven-enforcer-api) + (name "maven-enforcer-parent-pom") + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (install-pom-file "pom.xml"))))) + (propagated-inputs + `(("maven-parent-pom" ,maven-parent-pom-30))))) diff --git a/gnu/packages/patches/maven-enforcer-api-fix-old-dependencies.patch b/gnu/packages/patches/maven-enforcer-api-fix-old-dependencies.patch new file mode 100644 index 0000000000..98a0c8a395 --- /dev/null +++ b/gnu/packages/patches/maven-enforcer-api-fix-old-dependencies.patch @@ -0,0 +1,177 @@ +From eccc46eaf7903a8e837813795498b12c078faaea Mon Sep 17 00:00:00 2001 +From: Julien Lepiller +Date: Wed, 11 Mar 2020 21:53:32 +0100 +Subject: [PATCH] Fix old dependencies + +--- + .../enforcer/AbstractBanDependencies.java | 2 +- + .../enforcer/BanTransitiveDependencies.java | 2 +- + .../enforcer/DependencyConvergence.java | 17 ++++++++--------- + .../enforcer/RequireUpperBoundDeps.java | 19 +++++++++---------- + .../enforcer/utils/DependencyVersionMap.java | 6 +++--- + 5 files changed, 22 insertions(+), 24 deletions(-) + +diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java +index 2888a61..2b944b7 100644 +--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java ++++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java +@@ -119,7 +119,7 @@ public abstract class AbstractBanDependencies + Set dependencies = null; + try + { +- DependencyNode node = graphBuilder.buildDependencyGraph( project, null ); ++ DependencyNode node = graphBuilder.buildDependencyGraph( project.getProjectBuildingRequest(), null ); + if ( searchTransitive ) + { + dependencies = ArtifactUtils.getAllDescendants( node ); +diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java +index 6e1dcd4..1b964ba 100644 +--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java ++++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java +@@ -158,7 +158,7 @@ public class BanTransitiveDependencies + try + { + MavenProject project = (MavenProject) helper.evaluate( "${project}" ); +- rootNode = createDependencyGraphBuilder().buildDependencyGraph( project, null ); ++ rootNode = createDependencyGraphBuilder().buildDependencyGraph( project.getProjectBuildingRequest(), null ); + } + catch ( Exception e ) + { +diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java +index 684f984..ca7ad3a 100644 +--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java ++++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java +@@ -35,9 +35,9 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; + import org.apache.maven.plugin.logging.Log; + import org.apache.maven.plugins.enforcer.utils.DependencyVersionMap; + import org.apache.maven.project.MavenProject; +-import org.apache.maven.shared.dependency.tree.DependencyNode; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; ++import org.apache.maven.shared.dependency.graph.DependencyNode; ++import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; ++import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; + import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; + import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +@@ -60,7 +60,7 @@ public class DependencyConvergence + // CHECKSTYLE_OFF: LineLength + /** + * Uses the {@link EnforcerRuleHelper} to populate the values of the +- * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)} ++ * {@link DependencyGraphBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)} + * factory method.
+ * This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do. + * +@@ -75,16 +75,15 @@ public class DependencyConvergence + try + { + MavenProject project = (MavenProject) helper.evaluate( "${project}" ); +- DependencyTreeBuilder dependencyTreeBuilder = +- (DependencyTreeBuilder) helper.getComponent( DependencyTreeBuilder.class ); ++ DependencyGraphBuilder dependencyTreeBuilder = ++ (DependencyGraphBuilder) helper.getComponent( DependencyGraphBuilder.class ); + ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" ); + ArtifactFactory factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class ); + ArtifactMetadataSource metadataSource = + (ArtifactMetadataSource) helper.getComponent( ArtifactMetadataSource.class ); + ArtifactCollector collector = (ArtifactCollector) helper.getComponent( ArtifactCollector.class ); + ArtifactFilter filter = null; // we need to evaluate all scopes +- DependencyNode node = dependencyTreeBuilder.buildDependencyTree( project, repository, factory, +- metadataSource, filter, collector ); ++ DependencyNode node = dependencyTreeBuilder.buildDependencyGraph( project.getProjectBuildingRequest(), filter); + return node; + } + catch ( ExpressionEvaluationException e ) +@@ -95,7 +94,7 @@ public class DependencyConvergence + { + throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); + } +- catch ( DependencyTreeBuilderException e ) ++ catch ( DependencyGraphBuilderException e ) + { + throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e ); + } +diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java +index 458554a..2de9870 100644 +--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java ++++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java +@@ -38,10 +38,10 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; + import org.apache.maven.plugin.logging.Log; + import org.apache.maven.project.MavenProject; +-import org.apache.maven.shared.dependency.tree.DependencyNode; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; +-import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor; ++import org.apache.maven.shared.dependency.graph.DependencyNode; ++import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; ++import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; ++import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor; + import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; + import org.codehaus.plexus.component.repository.exception.ComponentLookupException; + +@@ -91,7 +91,7 @@ public class RequireUpperBoundDeps + // CHECKSTYLE_OFF: LineLength + /** + * Uses the {@link EnforcerRuleHelper} to populate the values of the +- * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)} ++ * {@link DependencyGraphBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)} + * factory method.
+ * This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do. + * +@@ -106,8 +106,8 @@ public class RequireUpperBoundDeps + try + { + MavenProject project = (MavenProject) helper.evaluate( "${project}" ); +- DependencyTreeBuilder dependencyTreeBuilder = +- (DependencyTreeBuilder) helper.getComponent( DependencyTreeBuilder.class ); ++ DependencyGraphBuilder dependencyTreeBuilder = ++ (DependencyGraphBuilder) helper.getComponent( DependencyGraphBuilder.class ); + ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" ); + ArtifactFactory factory = (ArtifactFactory) helper.getComponent( ArtifactFactory.class ); + ArtifactMetadataSource metadataSource = +@@ -115,8 +115,7 @@ public class RequireUpperBoundDeps + ArtifactCollector collector = (ArtifactCollector) helper.getComponent( ArtifactCollector.class ); + ArtifactFilter filter = null; // we need to evaluate all scopes + DependencyNode node = +- dependencyTreeBuilder.buildDependencyTree( project, repository, factory, metadataSource, filter, +- collector ); ++ dependencyTreeBuilder.buildDependencyGraph( project.getProjectBuildingRequest(), filter); + return node; + } + catch ( ExpressionEvaluationException e ) +@@ -127,7 +126,7 @@ public class RequireUpperBoundDeps + { + throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e ); + } +- catch ( DependencyTreeBuilderException e ) ++ catch ( DependencyGraphBuilderException e ) + { + throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e ); + } +diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java +index b6213fa..2c2a645 100644 +--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java ++++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java +@@ -26,8 +26,8 @@ import java.util.Map; + + import org.apache.maven.artifact.Artifact; + import org.apache.maven.plugin.logging.Log; +-import org.apache.maven.shared.dependency.tree.DependencyNode; +-import org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor; ++import org.apache.maven.shared.dependency.graph.DependencyNode; ++import org.apache.maven.shared.dependency.graph.traversal.DependencyNodeVisitor; + + /** + * @author Brian Fox +@@ -132,4 +132,4 @@ public class DependencyVersionMap + } + return output; + } +-} +\ No newline at end of file ++} +-- +2.24.1 + -- cgit v1.2.3 From 17666c090b6329bf0be3bb068382d9cd4aafab01 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Wed, 15 Jul 2020 22:02:24 +0200 Subject: gnu: Add Rust 1.45. * gnu/packages/rust.scm (rust-1.45): New variable. * gnu/packages/patches/rust-1.45-linker-locale.patch: New file. * gnu/local.mk (dist_patch_DATA): Add the patch to the list. --- gnu/local.mk | 1 + gnu/packages/patches/rust-1.45-linker-locale.patch | 14 ++++++++ gnu/packages/rust.scm | 37 +++++++++++++++++++++- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/rust-1.45-linker-locale.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index b174cdeaf5..b3811a473f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1518,6 +1518,7 @@ dist_patch_DATA = \ %D%/packages/patches/runc-CVE-2019-5736.patch \ %D%/packages/patches/rust-1.19-mrustc.patch \ %D%/packages/patches/rust-1.25-accept-more-detailed-gdb-lines.patch \ + %D%/packages/patches/rust-1.45-linker-locale.patch \ %D%/packages/patches/rust-bootstrap-stage0-test.patch \ %D%/packages/patches/rust-coresimd-doctest.patch \ %D%/packages/patches/rust-nettle-disable-vendor.patch \ diff --git a/gnu/packages/patches/rust-1.45-linker-locale.patch b/gnu/packages/patches/rust-1.45-linker-locale.patch new file mode 100644 index 0000000000..40220e8e77 --- /dev/null +++ b/gnu/packages/patches/rust-1.45-linker-locale.patch @@ -0,0 +1,14 @@ +Patch will be included upstream in 1.47: https://github.com/rust-lang/rust/pull/74416 +diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs +index e64aafa599f..12575ac4358 100644 +--- a/src/librustc_codegen_ssa/back/linker.rs ++++ b/src/librustc_codegen_ssa/back/linker.rs +@@ -28,7 +28,7 @@ use rustc_target::spec::{LinkOutputKind, LinkerFlavor, LldFlavor}; + pub fn disable_localization(linker: &mut Command) { + // No harm in setting both env vars simultaneously. + // Unix-style linkers. +- linker.env("LC_ALL", "C"); ++ linker.env("LC_ALL", "en_US.UTF-8"); + // MSVC's `link.exe`. + linker.env("VSLANG", "1033"); + } diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm index 851a996e4b..b0ad992138 100644 --- a/gnu/packages/rust.scm +++ b/gnu/packages/rust.scm @@ -1280,7 +1280,42 @@ move around." (rust-bootstrapped-package rust-1.43 "1.44.1" "0ww4z2v3gxgn3zddqzwqya1gln04p91ykbrflnpdbmcd575n8bky")) -;; NOTE: An update to LLVM 10 is coming in 1.45, make sure not to miss it. +(define-public rust-1.45 + (let ((base-rust + (rust-bootstrapped-package rust-1.44 "1.45.0" + "0z6dh0yd3fcm3qh960wi4s6fa6pxz9mh77psycsqfkkx5kqra15s"))) + (package + (inherit base-rust) + (source + (origin + (inherit (package-source base-rust)) + (patches (search-patches "rust-1.45-linker-locale.patch")))) + (inputs + (alist-replace "llvm" (list llvm-10) + (package-inputs base-rust))) + (arguments + (substitute-keyword-arguments (package-arguments base-rust) + ((#:phases phases) + `(modify-phases ,phases + ;; These tests make sure that the parser behaves properly when + ;; a source file starts with a shebang. Unfortunately, + ;; the patch-shebangs phase changes the meaning of these edge-cases. + ;; We skip the test since it's drastically unlikely Guix's packaging + ;; will introduce a bug here. + (add-after 'patch-tests 'skip-shebang-tests + (lambda _ + (with-directory-excursion "src/test/ui/parser/shebang" + (delete-file "shebang-doc-comment.rs") + (delete-file "sneaky-attrib.rs") + #t))) + ;; This test case synchronizes itself by starting a localhost TCP + ;; server. This doesn't work as networking is not available. + (add-after 'patch-tests 'skip-networking-test + (lambda _ + (substitute* "src/tools/cargo/tests/testsuite/freshness.rs" + (("fn linking_interrupted" all) + (string-append "#[ignore] " all))) + #t))))))))) ;; TODO(staging): Bump this variable to the latest packaged rust. (define-public rust rust-1.39) -- cgit v1.2.3 From c164c402a1899ffd2b2caba541b51e05855e94b8 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 14 Jul 2020 22:37:13 -0400 Subject: gnu: ruby-rubocop: Update to 0.88.0. * gnu/packages/patches/ruby-rubocop-break-dependency-cycle.patch: New file. * gnu/local.mk (dist_patch_DATA): Register patch. * gnu/packages/ruby.scm (ruby-rubocop): Update to 0.88.0. [origin]: Use git-fetch. Apply the newly added patch. [arguments]: Set #:test-target to "default". Remove #:tests?, enabling tests. [phases]{remove-problematic-tests, disable-bundler, set-home, make-adoc-files-writable}: New phases. Replace the 'replace-git-ls-files phase. [native-inputs]: Add ruby-bump, ruby-pry, ruby-rspec, ruby-test-queue, ruby-webmock-2 and ruby-yard. [propagated-inputs]: Remove ruby-powerpack and ruby-jaro-winkler. Add ruby-regexp-parser, ruby-rexml and ruby-rubocop-ast. --- gnu/local.mk | 1 + .../ruby-rubocop-break-dependency-cycle.patch | 101 +++++++++++++++++++++ gnu/packages/ruby.scm | 68 ++++++++++++-- 3 files changed, 160 insertions(+), 10 deletions(-) create mode 100644 gnu/packages/patches/ruby-rubocop-break-dependency-cycle.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index b3811a473f..e8915990bc 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1513,6 +1513,7 @@ dist_patch_DATA = \ %D%/packages/patches/racket-store-checksum-override.patch \ %D%/packages/patches/retroarch-disable-online-updater.patch \ %D%/packages/patches/ruby-rack-ignore-failing-test.patch \ + %D%/packages/patches/ruby-rubocop-break-dependency-cycle.patch\ %D%/packages/patches/ruby-sanitize-system-libxml.patch \ %D%/packages/patches/ruby-tzinfo-data-ignore-broken-test.patch\ %D%/packages/patches/runc-CVE-2019-5736.patch \ diff --git a/gnu/packages/patches/ruby-rubocop-break-dependency-cycle.patch b/gnu/packages/patches/ruby-rubocop-break-dependency-cycle.patch new file mode 100644 index 0000000000..035a98fa33 --- /dev/null +++ b/gnu/packages/patches/ruby-rubocop-break-dependency-cycle.patch @@ -0,0 +1,101 @@ +From ff3f00b7f33332ebf1c3c05abc4a781684775b3c Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Tue, 14 Jul 2020 11:50:12 -0400 +Subject: [PATCH] config: Drop rubocop-performance, rubocop-rspec requirements. + +This patch removes Rubocop extensions from Rubocop's closure to break +a dependency cycle with itself. + +* .rubocop.yml: Remove rubocop-performance and rubocop-rspec and their +corresponding directives. +* .rubocop_todo.yml: Likewise. +--- + .rubocop.yml | 15 --------------- + .rubocop_todo.yml | 44 -------------------------------------------- + 2 files changed, 59 deletions(-) + +diff --git a/.rubocop.yml b/.rubocop.yml +index 4f05d5be2..f12ef7c06 100644 +--- a/.rubocop.yml ++++ b/.rubocop.yml +@@ -3,8 +3,6 @@ + inherit_from: .rubocop_todo.yml + require: + - rubocop/cop/internal_affairs +- - rubocop-performance +- - rubocop-rspec + + AllCops: + NewCops: enable +@@ -106,16 +104,3 @@ Metrics/ClassLength: + Metrics/ModuleLength: + Exclude: + - 'spec/**/*.rb' +- +-RSpec/FilePath: +- Exclude: +- - spec/rubocop/formatter/junit_formatter_spec.rb +- +-RSpec/PredicateMatcher: +- EnforcedStyle: explicit +- +-RSpec/MessageSpies: +- EnforcedStyle: receive +- +-RSpec/NestedGroups: +- Max: 7 +diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml +index 3f72042d1..fa637cd42 100644 +--- a/.rubocop_todo.yml ++++ b/.rubocop_todo.yml +@@ -24,47 +24,3 @@ Metrics/MethodLength: + # Configuration parameters: CountComments. + Metrics/ModuleLength: + Max: 132 +- +-# Offense count: 10 +-RSpec/AnyInstance: +- Exclude: +- - 'spec/rubocop/cli_spec.rb' +- - 'spec/rubocop/cop/lint/duplicate_methods_spec.rb' +- - 'spec/rubocop/cop/team_spec.rb' +- - 'spec/rubocop/target_finder_spec.rb' +- +-# Offense count: 981 +-# Configuration parameters: Prefixes. +-# Prefixes: when, with, without +-RSpec/ContextWording: +- Enabled: false +- +-# Offense count: 3810 +-# Configuration parameters: Max. +-RSpec/ExampleLength: +- Enabled: false +- +-# Offense count: 38 +-RSpec/ExpectOutput: +- Exclude: +- - 'spec/rubocop/cli/cli_auto_gen_config_spec.rb' +- - 'spec/rubocop/cli/cli_options_spec.rb' +- - 'spec/rubocop/config_spec.rb' +- - 'spec/rubocop/cop/cop_spec.rb' +- - 'spec/rubocop/formatter/disabled_config_formatter_spec.rb' +- - 'spec/rubocop/formatter/formatter_set_spec.rb' +- - 'spec/rubocop/options_spec.rb' +- - 'spec/rubocop/rake_task_spec.rb' +- - 'spec/rubocop/result_cache_spec.rb' +- - 'spec/rubocop/target_finder_spec.rb' +- +-# Offense count: 434 +-RSpec/MultipleExpectations: +- Max: 25 +- +-# Offense count: 5 +-RSpec/SubjectStub: +- Exclude: +- - 'spec/rubocop/config_spec.rb' +- - 'spec/rubocop/formatter/json_formatter_spec.rb' +- - 'spec/rubocop/formatter/progress_formatter_spec.rb' +-- +2.27.0 + diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm index 0fae903592..8b87449d7d 100644 --- a/gnu/packages/ruby.scm +++ b/gnu/packages/ruby.scm @@ -6664,25 +6664,73 @@ run.") (define-public ruby-rubocop (package (name "ruby-rubocop") - (version "0.77.0") + (version "0.88.0") (source (origin - (method url-fetch) - (uri (rubygems-uri "rubocop" version)) + (method git-fetch) ;no tests in distributed gem + (uri (git-reference + (url "https://github.com/rubocop-hq/rubocop.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) (sha256 (base32 - "0m88b1bgbhmmbdnz2xv6n0il0j4q5qm9jbc0vf1zsaxmxqp06nx9")))) + "1d06893jp8pd85fvgp5d16vqcf31bafi430v4f4y746ihyvhzz5r")) + (patches (search-patches "ruby-rubocop-break-dependency-cycle.patch")))) (build-system ruby-build-system) (arguments - '(;; No included tests - #:tests? #f)) + '(#:test-target "default" + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'remove-problematic-tests + ;; These tests depend on Rubocop extensions, which cannot be + ;; included as they cause a dependency cycle with Rubocop itself. + (lambda _ + (delete-file "spec/rubocop/config_loader_spec.rb") + (substitute* "Gemfile" + ((".*'rubocop-performance'.*") "") + ((".*'rubocop-rspec'.*") "")) + ;; Prevent "Unnecessary disabling of RSpec/* (unknown cop)" + ;; errors. + (substitute* (find-files "spec/rubocop/cop/" "_spec\\.rb$") + (("# (rubocop:(enable|disable) RSpec.*)" _ what) + (string-append "# Disabled: " what))) + #t)) + (add-after 'unpack 'disable-bundler + (lambda _ + (substitute* "Rakefile" + (("Bundler\\.setup.*") "nil\n")) + #t)) + (replace 'replace-git-ls-files + (lambda _ + (substitute* "rubocop.gemspec" + (("`git ls-files(.*)`" _ files) + (format #f "`find ~a -type f| sort`" files))) + #t)) + (add-before 'check 'set-home + (lambda _ + (setenv "HOME" (getcwd)) + #t)) + (add-before 'check 'make-adoc-files-writable + (lambda _ + (let ((adoc-files (find-files "docs/modules/ROOT/pages" + "\\.adoc$"))) + (for-each make-file-writable adoc-files)) + #t))))) + (native-inputs + `(("ruby-bump" ,ruby-bump) + ("ruby-pry" ,ruby-pry) + ("ruby-rspec" ,ruby-rspec) + ("ruby-test-queue" ,ruby-test-queue) + ("ruby-webmock" ,ruby-webmock-2) + ("ruby-yard" ,ruby-yard))) (propagated-inputs - `(("ruby-parser" ,ruby-parser) - ("ruby-powerpack" ,ruby-powerpack) + `(("ruby-parallel" ,ruby-parallel) + ("ruby-parser" ,ruby-parser) ("ruby-rainbow" ,ruby-rainbow) + ("ruby-regexp-parser" ,ruby-regexp-parser) + ("ruby-rexml" ,ruby-rexml) + ("ruby-rubocop-ast" ,ruby-rubocop-ast) ("ruby-progressbar" ,ruby-progressbar) - ("ruby-parallel" ,ruby-parallel) - ("ruby-jaro-winkler" ,ruby-jaro-winkler) ("ruby-unicode-display-width" ,ruby-unicode-display-width))) (synopsis "Ruby code style checking tool") (description -- cgit v1.2.3 From c91c132fc42c6e67140b393b963d7ced009f093e Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 19 Jul 2020 08:59:48 +0200 Subject: gnu: ungoogled-chromium: Update to 84.0.4147.89-0.df199c0. * gnu/packages/patches/ungoogled-chromium-system-jsoncpp.patch, gnu/packages/patches/ungoogled-chromium-system-zlib.patch: Delete files. * gnu/packages/patches/ungoogled-chromium-system-nspr.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/chromium.scm (%preserved-third-party-files): Adjust for 84. (%ungoogled-revision): Set to df199c04ff367da59ce52a23a3f3b305dd3b00c3. (%debian-revision): Set to debian/83.0.4103.116-3. (%gentoo-revision): Set to f3f649046d31ebdbc8c4a302b2384504eff78027. (chromium-gcc-patchset, %chromium-gcc-patches): New variables. (%gentoo-patches): Remove GCC patches, which have been moved to the above repo. Add ffmpeg compatibility patch. (%debian-patches): Add zlib and jsoncpp patch; remove nspr patch. (%ungoogled-origin): Update hash. (ungoogled-chromium-snippet): Add the new GCC patches. Remove obsolete local patches, add new. (xcb-proto/python2): New variable. (ungoogled-chromium): Update to 84.0.4147.89-0..df199c0. [arguments]: Add "is_unsafe_developer_build", "max_jobs_per_link", "exclude_unwind_tables", "xcbproto_path", "perfetto_use_system_protobuf" to #:configure-flags. Remove "linux_use_bundled_binutils". Adjust vulkan header substitutions. [native-inputs]: Remove YASM. [inputs]: Change from FFMPEG-4.2 to FFMPEG. Add PROTOBUF and XCB-PROTO/PYTHON2. --- gnu/local.mk | 3 +- gnu/packages/chromium.scm | 130 +++++++++++---------- .../ungoogled-chromium-system-jsoncpp.patch | 65 ----------- .../patches/ungoogled-chromium-system-nspr.patch | 120 +++++++++++++++++++ .../patches/ungoogled-chromium-system-zlib.patch | 47 -------- 5 files changed, 187 insertions(+), 178 deletions(-) delete mode 100644 gnu/packages/patches/ungoogled-chromium-system-jsoncpp.patch create mode 100644 gnu/packages/patches/ungoogled-chromium-system-nspr.patch delete mode 100644 gnu/packages/patches/ungoogled-chromium-system-zlib.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index e8915990bc..0eac01d72d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1594,8 +1594,7 @@ dist_patch_DATA = \ %D%/packages/patches/u-boot-riscv64-fix-extlinux.patch \ %D%/packages/patches/ucx-tcp-iface-ioctl.patch \ %D%/packages/patches/udiskie-no-appindicator.patch \ - %D%/packages/patches/ungoogled-chromium-system-jsoncpp.patch \ - %D%/packages/patches/ungoogled-chromium-system-zlib.patch \ + %D%/packages/patches/ungoogled-chromium-system-nspr.patch \ %D%/packages/patches/unzip-CVE-2014-8139.patch \ %D%/packages/patches/unzip-CVE-2014-8140.patch \ %D%/packages/patches/unzip-CVE-2014-8141.patch \ diff --git a/gnu/packages/chromium.scm b/gnu/packages/chromium.scm index d9ba53d832..7ce9b65abf 100644 --- a/gnu/packages/chromium.scm +++ b/gnu/packages/chromium.scm @@ -55,6 +55,7 @@ #:use-module (gnu packages nss) #:use-module (gnu packages pciutils) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages protobuf) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) #:use-module (gnu packages python-web) @@ -137,6 +138,8 @@ "third_party/dawn" ;ASL2.0 "third_party/depot_tools/owners.py" ;BSD-3 "third_party/devtools-frontend" ;BSD-3 + "third_party/devtools-frontend/src/front_end/third_party/acorn" ;Expat + "third_party/devtools-frontend/src/front_end/third_party/codemirror" ;Expat "third_party/devtools-frontend/src/front_end/third_party/fabricjs" ;Expat "third_party/devtools-frontend/src/front_end/third_party/lighthouse" ;ASL2.0 "third_party/devtools-frontend/src/front_end/third_party/wasmparser" ;ASL2.0 @@ -159,6 +162,7 @@ "third_party/jstemplate" ;ASL2.0 "third_party/khronos" ;Expat, SGI "third_party/leveldatabase" ;BSD-3 + "third_party/libavif" ;BSD-2 "third_party/libXNVCtrl" ;Expat "third_party/libaddressinput" ;ASL2.0 "third_party/libaom" ;BSD-2 or "Alliance for Open Media Patent License 1.0" @@ -174,6 +178,7 @@ "third_party/libwebm" ;BSD-3 "third_party/libxml/chromium" ;BSD-3 "third_party/libyuv" ;BSD-3 + "third_party/lottie" ;Expat "third_party/lss" ;BSD-3 "third_party/mako" ;Expat "third_party/markupsafe" ;BSD-3 @@ -186,6 +191,7 @@ "third_party/one_euro_filter" ;BSD-3 "third_party/openscreen" ;BSD-3 "third_party/openscreen/src/third_party/tinycbor" ;Expat + "third_party/openscreen/src/third_party/mozilla" ;MPL1.1/GPL2+/LGPL2.1+, BSD-3 "third_party/ots" ;BSD-3 "third_party/pdfium" ;BSD-3 "third_party/pdfium/third_party/agg23" ;Expat @@ -223,12 +229,13 @@ "third_party/swiftshader/third_party/SPIRV-Headers" ;X11-style "third_party/usb_ids" ;BSD-3 "third_party/usrsctp" ;BSD-2 + "third_party/vulkan_memory_allocator" ;Expat "third_party/wayland/wayland_scanner_wrapper.py" ;BSD-3 "third_party/wayland-protocols" ;Expat "third_party/web-animations-js" ;ASL2.0 "third_party/webdriver" ;ASL2.0 "third_party/webrtc" ;BSD-3 - "third_party/webrtc/common_audio/third_party/fft4g" ;Non-copyleft + "third_party/webrtc/common_audio/third_party/ooura" ;Non-copyleft "third_party/webrtc/common_audio/third_party/spl_sqrt_floor" ;Public domain "third_party/webrtc/modules/third_party/fft" ;Non-copyleft "third_party/webrtc/modules/third_party/g711" ;Public domain @@ -239,7 +246,6 @@ "third_party/widevine/cdm/widevine_cdm_common.h" ;BSD-3 "third_party/woff2" ;ASL2.0 "third_party/xdg-utils" ;Expat - "third_party/yasm/run_yasm.py" ;BSD-2 or BSD-3 "third_party/zlib/google" ;BSD-3 "url/third_party/mozilla" ;BSD-3, MPL1.1/GPL2+/LGPL2.1+ "v8/src/third_party/siphash" ;Public domain @@ -254,10 +260,6 @@ ;; run the Blink performance tests, just remove everything to save ~24MiB. '("third_party/blink/perf_tests")) -(define %ungoogled-revision "f08ce8b3f1300ef0750b5d6bf967b9cbbfd9a56d") -(define %debian-revision "debian/81.0.4044.92-1") -(define %gentoo-revision "55ef09d6709f4e4cbe23418e4ade0f219fa2fa1f") - (define (gentoo-patch name revision hash) (origin (method url-fetch) @@ -266,39 +268,15 @@ (file-name (string-append "ungoogled-" name)) (sha256 (base32 hash)))) -(define %gentoo-patches - (list (gentoo-patch "chromium-fix-char_traits.patch" %gentoo-revision - "1zr9wj2rj5phwdiffykd8w3srmzn0xxgmznz762qp7rs7amnp8ns") - (gentoo-patch "chromium-blink-style_format.patch" %gentoo-revision - "098akk5l01m0n3zz08ycz1kp3xmjnbng6d399z1fnb2zigbf0b0z") - (gentoo-patch "chromium-78-protobuf-export.patch" %gentoo-revision - "1wbw29daqwyrnij4991v84955ydqfvvjpz4s2p40agnzmgdzwnsx") - (gentoo-patch "chromium-79-gcc-alignas.patch" %gentoo-revision - "1a6l4i9cicy8dpxxjamyw8cl2nmqfv3x9gbffrsr8571my6fh17s") - (gentoo-patch "chromium-80-gcc-quiche.patch" %gentoo-revision - "0rdlsymw6h8i6yhysiq4la53pwivzv1i9lh0gprh5cl367r1haww") - (gentoo-patch "chromium-82-gcc-noexcept.patch" %gentoo-revision - "0pljnysjvbv2ck0s159qssjhv1pfr32i0nb66smmfmfix2yaizqc") - (gentoo-patch "chromium-82-gcc-incomplete-type.patch" %gentoo-revision - "04751dnpmiasifhq29a1kyxlnq6f2fmd2qbkv7hxdlsxbzg3lhsv") - (gentoo-patch "chromium-82-gcc-template.patch" %gentoo-revision - "1ilmx9wmzyrwmfvr2mwc7m5z6lnbhjkms5k40i8yavqah6kcdbw2") - (gentoo-patch "chromium-82-gcc-iterator.patch" %gentoo-revision - "1xljai9cj99pf4q3l8hz90i8mhdbd8v6h1vj8y37v6j8p78n3zvj") - (gentoo-patch "chromium-83-gcc-template.patch" %gentoo-revision - "1bb1anqdrimza7d0gg4fmxij00563jd9k1azy8sz1ybd8gvrphqi") - (gentoo-patch "chromium-83-gcc-include.patch" %gentoo-revision - "0rs9jj71ridplndi967m0z47vqd8ryykg36gjx8iyf3580vr2hlw") - (gentoo-patch "chromium-83-gcc-permissive.patch" %gentoo-revision - "04mrmrg3pbwl3gph2n1dkbv4miz80xww1gysd39six028nxacjpg") - (gentoo-patch "chromium-83-gcc-iterator.patch" %gentoo-revision - "0q66399va607kjnk8n9xlcr740q7c522p2z7abyd2hgq2bxgglnv") - (gentoo-patch "chromium-83-gcc-serviceworker.patch" %gentoo-revision - "0klvcqqzldfhvqr3plja64qamgff1m2z1zcn325bj32gmpypqjx9") - (gentoo-patch "chromium-83-gcc-10.patch" %gentoo-revision - "0vfvh1jypqcb274bggacg165mw2q5gmn237cvrrwcjqalz0ahnry") - (gentoo-patch "chromium-83-icu67.patch" %gentoo-revision - "05spmjhg5f56mkq3f96vm4s2d9h6vqdxz5g8ibd9pf8ddnh4blnx"))) +;; This repository contains libstdc++ compatibility patches for Chromium. +(define (chromium-gcc-patchset commit hash) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/stha09/chromium-patches") + (commit commit))) + (file-name (git-file-name "chromium-gcc-patches" commit)) + (sha256 (base32 hash)))) (define (debian-patch name revision hash) (origin @@ -310,9 +288,25 @@ (string-append "ungoogled-chromium-" category "-" name)))) (sha256 (base32 hash)))) +(define %ungoogled-revision "df199c04ff367da59ce52a23a3f3b305dd3b00c3") +(define %debian-revision "debian/83.0.4103.116-3") +(define %gentoo-revision "f3f649046d31ebdbc8c4a302b2384504eff78027") + +(define %gentoo-patches + ;; This patch is necessary for compatibility with FFmpeg 4.3. + (list (gentoo-patch "chromium-84-mediaalloc.patch" %gentoo-revision + "0snxdc4nb8ykzncz62vpsl8hgxpy24m17mycx67i2gckmrpslzzv"))) + +(define %chromium-gcc-patches + (chromium-gcc-patchset + "chromium-84-patchset-3" + "0l05gx3pn703n47anjwsl5sjcqw8kaxmivf7llax97kj3k6d127v")) + (define %debian-patches - (list (debian-patch "system/nspr.patch" %debian-revision - "1x6ydc8pfks2c1dlwf0c58par6znjknvs9815576ycx27jl633dy") + (list (debian-patch "system/zlib.patch" %debian-revision + "0bp2vh1cgmwjrn1zkpphkd3bs662s23xwdhy3abm9cfjvwrj117n") + (debian-patch "system/jsoncpp.patch" %debian-revision + "0d95brl4a5y5w142yd0rvf59z513h7chsz0vnm034d6lqf22ahwf") (debian-patch "system/openjpeg.patch" %debian-revision "0zd6v5njx1pc7i0y6mslxvpx5j4cq01mmyx55qcqx8qzkm0gm48j"))) @@ -325,7 +319,7 @@ (string-take %ungoogled-revision 7))) (sha256 (base32 - "0kc40p8f7cls696gh6ign37l8j4x1pyyz32jkkli9cmrpbsjsadl")))) + "1bqvcq3dj6615198j7cz3ylyyic5zpis06capvl6ybl1na3ainb0")))) ;; This is a source 'snippet' that does the following: ;; *) Applies various patches for unbundling purposes and libstdc++ compatibility. @@ -350,12 +344,10 @@ patch "--no-backup-if-mismatch")) (append '#+%gentoo-patches '#+%debian-patches + (find-files #$%chromium-gcc-patches "\\.patch$") '#+(list (local-file (search-patch - "ungoogled-chromium-system-jsoncpp.patch")) - (local-file - (search-patch - "ungoogled-chromium-system-zlib.patch"))))) + "ungoogled-chromium-system-nspr.patch"))))) (with-directory-excursion #+%ungoogled-origin (format #t "Ungooglifying...~%") @@ -386,8 +378,7 @@ "--system-libraries" "ffmpeg" "flac" "fontconfig" "freetype" "harfbuzz-ng" "icu" "libdrm" "libevent" "libjpeg" "libpng" "libvpx" "libwebp" "libxml" - "libxslt" "openh264" "opus" "re2" "snappy" "yasm" - "zlib") + "libxslt" "openh264" "opus" "re2" "snappy" "zlib") #t)))) (define opus+custom @@ -402,10 +393,20 @@ `(cons "--enable-custom-modes" ,flags)))))) +;; Chromium still has Python2-only code, so we need this special Python 2 +;; variant of xcb-proto. +(define xcb-proto/python2 + (package/inherit + xcb-proto + (name "python2-xcb-proto") + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python-2))))) + (define-public ungoogled-chromium (package (name "ungoogled-chromium") - (version (string-append "83.0.4103.116-0." + (version (string-append "84.0.4147.89-0." (string-take %ungoogled-revision 7))) (synopsis "Graphical web browser") (source (origin @@ -415,7 +416,7 @@ (car (string-split version #\-)) ".tar.xz")) (sha256 (base32 - "1hravbi1lazmab2mih465alfzji1kzy38zya1visbwz9zs6pw35v")) + "0yf6j0459qzr677zsa2apmfz0x0ndlscvwj1a5v40nqjijchv5qp")) (modules '((guix build utils))) (snippet (force ungoogled-chromium-snippet)))) (build-system gnu-build-system) @@ -435,10 +436,13 @@ ;; directory for an exhaustive list of supported flags. ;; (Note: The 'configure' phase will do that for you.) (list "is_debug=false" + "is_unsafe_developer_build=false" "use_gold=false" "use_lld=false" + (string-append "max_jobs_per_link=" + (number->string (parallel-job-count))) + "exclude_unwind_tables=true" "clang_use_chrome_plugins=false" - "linux_use_bundled_binutils=false" "use_custom_libcxx=false" "use_sysroot=false" "enable_precompiled_headers=false" @@ -467,6 +471,9 @@ "custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" "host_toolchain=\"//build/toolchain/linux/unbundle:default\"" + (string-append "xcbproto_path=\"" + (assoc-ref %build-inputs "xcb-proto") "/share/xcb\"") + ;; Prefer system libraries. "use_system_freetype=true" "use_system_harfbuzz=true" @@ -481,6 +488,7 @@ "use_pulseaudio=true" "link_pulseaudio=true" "icu_use_data_file=false" + "perfetto_use_system_protobuf=true" ;; VA-API acceleration is currently only supported on x86_64-linux. ,@(if (string-prefix? "x86_64" (or (%current-target-system) @@ -568,13 +576,10 @@ (substitute* "third_party/webrtc/rtc_base/strings/json.h" (("#include \"third_party/jsoncpp/") "#include \"json/")) - (substitute* "gpu/config/gpu_util.cc" - (("third_party/vulkan/include/") - "")) - (substitute* '("components/viz/common/gpu/vulkan_context_provider.h" - "components/viz/common/resources/resource_format_utils.h") - (("third_party/vulkan/include/") "")) + "components/viz/common/resources/resource_format_utils.h" + "gpu/config/gpu_util.cc") + (("third_party/vulkan_headers/include/") "")) (substitute* "third_party/skia/include/gpu/vk/GrVkVulkan.h" (("include/third_party/vulkan/") "")) @@ -743,7 +748,6 @@ ("node" ,node) ("pkg-config" ,pkg-config) ("which" ,which) - ("yasm" ,yasm) ;; This file contains defaults for new user profiles. ("master-preferences" ,(local-file "aux-files/chromium/master-preferences.json")) @@ -760,11 +764,7 @@ ("dbus-glib" ,dbus-glib) ("expat" ,expat) ("flac" ,flac) - - ;; FIXME: Change to ffmpeg 4.3 when supported, see - ;; . - ("ffmpeg" ,ffmpeg-4.2) - + ("ffmpeg" ,ffmpeg) ("fontconfig" ,fontconfig) ("freetype" ,freetype) ("gdk-pixbuf" ,gdk-pixbuf) @@ -805,13 +805,15 @@ ("opus" ,opus+custom) ("pango" ,pango) ("pciutils" ,pciutils) + ("protobuf" ,protobuf) ("pulseaudio" ,pulseaudio) ("re2" ,re2) ("snappy" ,snappy) ("speech-dispatcher" ,speech-dispatcher) ("udev" ,eudev) ("valgrind" ,valgrind) - ("vulkan-headers" ,vulkan-headers))) + ("vulkan-headers" ,vulkan-headers) + ("xcb-proto" ,xcb-proto/python2))) ;; Building Chromium takes ... a very long time. On a single core, a busy ;; mid-end x86 system may need more than 24 hours to complete the build. diff --git a/gnu/packages/patches/ungoogled-chromium-system-jsoncpp.patch b/gnu/packages/patches/ungoogled-chromium-system-jsoncpp.patch deleted file mode 100644 index 294e1ea33b..0000000000 --- a/gnu/packages/patches/ungoogled-chromium-system-jsoncpp.patch +++ /dev/null @@ -1,65 +0,0 @@ -Build with the system jsoncpp instead of the bundled one. - -Adapted from Debian: -https://salsa.debian.org/chromium-team/chromium/-/blob/master/debian/patches/system/jsoncpp.patch - -diff --git a/third_party/jsoncpp/BUILD.gn b/third_party/jsoncpp/BUILD.gn ---- a/third_party/jsoncpp/BUILD.gn -+++ b/third_party/jsoncpp/BUILD.gn -@@ -3,52 +3,14 @@ - # found in the LICENSE file. - - import("//testing/libfuzzer/fuzzer_test.gni") -+import("//build/config/linux/pkg_config.gni") - --config("jsoncpp_config") { -- include_dirs = [ -- "source/include", -- "generated", -- ] -- -- # TODO(crbug.com/983223): Update JsonCpp BUILD.gn to remove deprecated -- # declaration flag. -- # This temporary flag allowing clients to update to the new version, and then -- # update to the new StreamWriter and CharReader classes. -- if (!is_win || is_clang) { -- cflags_cc = [ "-Wno-deprecated-declarations" ] -- } -+pkg_config("jsoncpp_config") { -+ packages = [ "jsoncpp" ] - } - --source_set("jsoncpp") { -- sources = [ -- "generated/version.h", -- "source/include/json/assertions.h", -- "source/include/json/autolink.h", -- "source/include/json/config.h", -- "source/include/json/features.h", -- "source/include/json/forwards.h", -- "source/include/json/json.h", -- "source/include/json/reader.h", -- "source/include/json/value.h", -- "source/include/json/writer.h", -- "source/src/lib_json/json_reader.cpp", -- "source/src/lib_json/json_tool.h", -- "source/src/lib_json/json_value.cpp", -- "source/src/lib_json/json_writer.cpp", -- ] -- -+group("jsoncpp") { - public_configs = [ ":jsoncpp_config" ] -- -- defines = [ -- "JSON_USE_EXCEPTION=0", -- "JSON_USE_NULLREF=0", -- ] -- -- include_dirs = [ "source/src/lib_json" ] -- -- if (!is_win || is_clang) { -- cflags_cc = [ "-Wno-implicit-fallthrough" ] -- } - } - - if (build_with_chromium) { diff --git a/gnu/packages/patches/ungoogled-chromium-system-nspr.patch b/gnu/packages/patches/ungoogled-chromium-system-nspr.patch new file mode 100644 index 0000000000..6fbc0a56a7 --- /dev/null +++ b/gnu/packages/patches/ungoogled-chromium-system-nspr.patch @@ -0,0 +1,120 @@ +Build with the system nspr library. + +Originally based on a Debian patch: +https://salsa.debian.org/chromium-team/chromium/-/blob/master/debian/patches/system/nspr.patch + +--- a/base/time/pr_time_unittest.cc ++++ b/base/time/pr_time_unittest.cc +@@ -7,7 +7,7 @@ + + #include "base/compiler_specific.h" + #include "base/stl_util.h" +-#include "base/third_party/nspr/prtime.h" ++#include + #include "base/time/time.h" + #include "build/build_config.h" + #include "testing/gtest/include/gtest/gtest.h" +--- a/base/time/time.cc ++++ b/base/time/time.cc +@@ -14,7 +14,7 @@ + #include "base/macros.h" + #include "base/no_destructor.h" + #include "base/strings/stringprintf.h" +-#include "base/third_party/nspr/prtime.h" ++#include + #include "base/time/time_override.h" + #include "build/build_config.h" + +--- a/base/BUILD.gn ++++ b/base/BUILD.gn +@@ -107,6 +107,9 @@ config("base_flags") { + "-Wglobal-constructors", + ] + } ++ ldflags = [ ++ "-lnspr4", ++ ] + } + + config("base_implementation") { +@@ -712,8 +715,6 @@ jumbo_component("base") { + "third_party/cityhash_v103/src/city_v103.h", + "third_party/icu/icu_utf.cc", + "third_party/icu/icu_utf.h", +- "third_party/nspr/prtime.cc", +- "third_party/nspr/prtime.h", + "third_party/superfasthash/superfasthash.c", + "thread_annotations.h", + "threading/hang_watcher.cc", +--- a/tools/gn/build/gen.py ++++ b/tools/gn/build/gen.py +@@ -339,6 +339,9 @@ def WriteGNNinja(path, platform, host, o + if not options.no_static_libstdcpp: + ldflags.append('-static-libstdc++') + ++ # Additional system libraries that are used. ++ libs.append('-lnspr4') ++ + # This is needed by libc++. + if not platform.is_mingw(): + libs.append('-ldl') +--- a/third_party/blink/renderer/platform/BUILD.gn ++++ b/third_party/blink/renderer/platform/BUILD.gn +@@ -103,6 +103,9 @@ + "//build/win:default_exe_manifest", + "//third_party/icu", + ] ++ ldflags = [ ++ "-lnspr4" ++ ] + } + + # This isn't strictly necessary since we can just add the deps to "platform", +--- a/third_party/crashpad/crashpad/handler/BUILD.gn ++++ b/third_party/crashpad/crashpad/handler/BUILD.gn +@@ -140,6 +140,9 @@ + "../third_party/mini_chromium:base", + "../tools:tool_support", + ] ++ ldflags = [ ++ "-lnspr4" ++ ] + + if (crashpad_is_win) { + if (crashpad_is_in_chromium || crashpad_is_in_dart) { +--- a/chrome/common/search/BUILD.gn ++++ b/chrome/common/search/BUILD.gn +@@ -20,6 +20,9 @@ + "//chrome/common/themes:autogenerated_theme_util", + "//skia", + ] ++ ldflags = [ ++ "-lnspr4" ++ ] + } + + compiled_action("generate_chrome_colors_info") { +--- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn ++++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn +@@ -31,6 +31,9 @@ + "//net/tools/huffman_trie:huffman_trie_generator_sources", + "//url:url", + ] ++ ldflags = [ ++ "-lnspr4", ++ ] + if (is_ios) { + libs = [ "UIKit.framework" ] + } +--- a/components/schema_org/BUILD.gn ++++ b/components/schema_org/BUILD.gn +@@ -33,6 +33,9 @@ + "//base", + "//url", + ] ++ ldflags = [ ++ "-lnspr4", ++ ] + } + + compiled_action("schema_org_name_data") { diff --git a/gnu/packages/patches/ungoogled-chromium-system-zlib.patch b/gnu/packages/patches/ungoogled-chromium-system-zlib.patch deleted file mode 100644 index b6e3c0f075..0000000000 --- a/gnu/packages/patches/ungoogled-chromium-system-zlib.patch +++ /dev/null @@ -1,47 +0,0 @@ -Use zlib instead of the bundled lzma_sdk. - -Adapted from Debian: -https://salsa.debian.org/chromium-team/chromium/-/blob/master/debian/patches/system/zlib.patch - -diff --git a/courgette/BUILD.gn b/courgette/BUILD.gn ---- a/courgette/BUILD.gn -+++ b/courgette/BUILD.gn -@@ -58,7 +58,6 @@ static_library("courgette_lib") { - - deps = [ - "//base", -- "//third_party/lzma_sdk", - ] - - public_deps = [ -@@ -79,7 +78,6 @@ source_set("courgette_common") { - ] - deps = [ - "//base", -- "//third_party/lzma_sdk", - ] - } - -diff --git a/courgette/crc.cc b/courgette/crc.cc ---- a/courgette/crc.cc -+++ b/courgette/crc.cc -@@ -7,6 +7,8 @@ - #include - #include - -+#define COURGETTE_USE_CRC_LIB -+ - #ifdef COURGETTE_USE_CRC_LIB - # include "zlib.h" - #else -diff --git a/third_party/perfetto/gn/BUILD.gn b/third_party/perfetto/gn/BUILD.gn ---- a/third_party/perfetto/gn/BUILD.gn -+++ b/third_party/perfetto/gn/BUILD.gn -@@ -304,7 +304,6 @@ if (enable_perfetto_zlib) { - public_configs = [ "//buildtools:zlib_config" ] - public_deps = [ "//buildtools:zlib" ] - } else { -- public_configs = [ "//third_party/zlib:zlib_config" ] - public_deps = [ "//third_party/zlib" ] - } - } -- cgit v1.2.3 From 64066abdb026755062b747f3d5b0ebe0efae7fc7 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Mon, 13 Jul 2020 17:25:00 +0200 Subject: gnu: python-aionotify: Fix test cases with Python 3.8. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/python-xyz.scm (patches): Add fix. * gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch: New file. * gnu/local.mk: Add it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + .../patches/python-aionotify-0.2.0-py3.8.patch | 48 ++++++++++++++++++++++ gnu/packages/python-xyz.scm | 4 +- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 0eac01d72d..7bae1daf61 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1450,6 +1450,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-3.8-fix-tests.patch \ %D%/packages/patches/python-CVE-2018-14647.patch \ %D%/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch \ + %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \ %D%/packages/patches/python-alembic-exceptions-cause.patch \ %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \ %D%/packages/patches/python-axolotl-AES-fix.patch \ diff --git a/gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch b/gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch new file mode 100644 index 0000000000..ebeef34720 --- /dev/null +++ b/gnu/packages/patches/python-aionotify-0.2.0-py3.8.patch @@ -0,0 +1,48 @@ +Compatibility with Python 3.8, see upstream issue +https://github.com/rbarrois/aionotify/pull/15 + +diff --git a/setup.py b/setup.py +index 21a554f..094de64 100755 +--- a/setup.py ++++ b/setup.py +@@ -40,7 +40,7 @@ setup( + setup_requires=[ + ], + tests_require=[ +- 'asynctest', ++ 'asynctest; python_version<"3.8"', + ], + classifiers=[ + "Development Status :: 4 - Beta", +diff --git a/tests/test_usage.py b/tests/test_usage.py +index f156291..0476ff1 100644 +--- a/tests/test_usage.py ++++ b/tests/test_usage.py +@@ -8,7 +8,11 @@ import os.path + import tempfile + import unittest + +-import asynctest ++try: ++ testBase = unittest.IsolatedAsyncioTestCase ++except AttributeError: ++ import asynctest ++ testBase = asynctest.TestCase + + import aionotify + +@@ -25,11 +29,13 @@ if AIODEBUG: + TESTDIR = os.environ.get('AIOTESTDIR') or os.path.join(os.path.dirname(__file__), 'testevents') + + +-class AIONotifyTestCase(asynctest.TestCase): ++class AIONotifyTestCase(testBase): + forbid_get_event_loop = True + timeout = 3 + + def setUp(self): ++ if not getattr (self, 'loop', None): ++ self.loop = asyncio.get_event_loop() + if AIODEBUG: + self.loop.set_debug(True) + self.watcher = aionotify.Watcher() diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index a48f39429d..748f48f229 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -19269,9 +19269,9 @@ and cuts down boilerplate code when testing libraries for asyncio.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1sk9i8czxgsbrswsf1nlb4c82vgnlzi8zrvrxdip92w2z8hqh43y")))) + (base32 "1sk9i8czxgsbrswsf1nlb4c82vgnlzi8zrvrxdip92w2z8hqh43y")) + (patches (search-patches "python-aionotify-0.2.0-py3.8.patch")))) (build-system python-build-system) - (native-inputs `(("python-asynctest" ,python-asynctest))) (home-page "https://github.com/rbarrois/aionotify") (synopsis "Asyncio-powered inotify library") (description -- cgit v1.2.3 From d4b02a6fba7c364ab7c8d257cf9a32134e71ce3e Mon Sep 17 00:00:00 2001 From: Brett Gilio Date: Tue, 21 Jul 2020 12:51:04 -0500 Subject: gnu: emacs-telega: Patch to use telega-server from Guix. * gnu/packages/patches/emacs-telega-patch-server-functions.patch: New file. * gnu/local.mk (dist_patch_DATA): Reference new patch. * gnu/packages/emacs-xyz.scm (emacs-telega)[source]: Use new patch, bump revision. --- gnu/local.mk | 1 + gnu/packages/emacs-xyz.scm | 6 +++-- .../emacs-telega-patch-server-functions.patch | 31 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/emacs-telega-patch-server-functions.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 7bae1daf61..8ba36acf57 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -916,6 +916,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-libgit-use-system-libgit2.patch \ %D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \ %D%/packages/patches/emacs-source-date-epoch.patch \ + %D%/packages/patches/emacs-telega-patch-server-functions.patch \ %D%/packages/patches/emacs-telega-test-env.patch \ %D%/packages/patches/emacs-undohist-ignored.patch \ %D%/packages/patches/emacs-wordnut-require-adaptive-wrap.patch \ diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm index 5b68eb548c..94772c3f4c 100644 --- a/gnu/packages/emacs-xyz.scm +++ b/gnu/packages/emacs-xyz.scm @@ -22266,7 +22266,7 @@ fish-completion. It can be used in both Eshell and M-x shell.") ;; Get the current version from `telega-version` in telega.el. ;; or by running M-x telega-version. (let ((commit "5c39c3a81e48222911db75ae30e5a8f8fa34efb5") - (revision "1") + (revision "2") (version "0.6.27")) (package (name "emacs-telega") @@ -22280,7 +22280,9 @@ fish-completion. It can be used in both Eshell and M-x shell.") (sha256 (base32 "0wyycgsb1ja73phs9a2dgi50m2p6sdvx3xdwclfyijx4hzwlv233")) - (patches (search-patches "emacs-telega-test-env.patch")) + (patches (search-patches + "emacs-telega-patch-server-functions.patch" + "emacs-telega-test-env.patch")) (file-name (git-file-name name version)))) (build-system gnu-build-system) (arguments diff --git a/gnu/packages/patches/emacs-telega-patch-server-functions.patch b/gnu/packages/patches/emacs-telega-patch-server-functions.patch new file mode 100644 index 0000000000..e3d49278d0 --- /dev/null +++ b/gnu/packages/patches/emacs-telega-patch-server-functions.patch @@ -0,0 +1,31 @@ +Remove interactive build for telega-server, as it fails on Guix. +Modify the `telega-server--find-bin' function to only use the version +of telega-server installed by Guix. + +Created by Brett Gilio + +--- a/telega-server.el ++++ b/telega-server.el +@@ -113,7 +113,6 @@ If already deferring, then just executes the BODY." + If BUILD-FLAGS is specified, then rebuild server without any + queries using this flags for building, could be empty string. + Otherwise query user about building flags." +- (interactive) + (telega-test-env 'quiet) + (when (or build-flags + (y-or-n-p "Build `telega-server'? ")) +@@ -137,11 +136,8 @@ Otherwise query user about building flags." + (defun telega-server--find-bin () + "Find telega-server executable. + Raise error if not found." +- (let ((exec-path (cons telega-directory exec-path))) +- (or (executable-find "telega-server") +- (progn (telega-server-build) +- (executable-find "telega-server")) +- (error "`telega-server' not found in exec-path")))) ++ (or (executable-find "telega-server") ++ (error "`telega-server' not found in exec-path"))) + + (defun telega-server-version () + "Return telega-server version." + -- cgit v1.2.3 From 2195ad6bd7df591c1f24b5717203b363bc3e1bfd Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Tue, 21 Jul 2020 22:18:50 +0200 Subject: gnu: libvnc: Update to 0.9.13. * gnu/packages/patches/libvnc-CVE-2018-20750.patch, gnu/packages/patches/libvnc-CVE-2019-15681.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/vnc.scm (libvnc): Update to 0.9.13. [source](patches): Remove. [arguments]: Add phase to patch 'cc' invocation. --- gnu/local.mk | 2 -- gnu/packages/patches/libvnc-CVE-2018-20750.patch | 44 ------------------------ gnu/packages/patches/libvnc-CVE-2019-15681.patch | 23 ------------- gnu/packages/vnc.scm | 15 +++++--- 4 files changed, 11 insertions(+), 73 deletions(-) delete mode 100644 gnu/packages/patches/libvnc-CVE-2018-20750.patch delete mode 100644 gnu/packages/patches/libvnc-CVE-2019-15681.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8ba36acf57..570e6a3b49 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1241,8 +1241,6 @@ dist_patch_DATA = \ %D%/packages/patches/libutils-add-includes.patch \ %D%/packages/patches/libutils-remove-damaging-includes.patch \ %D%/packages/patches/libvdpau-va-gl-unbundle.patch \ - %D%/packages/patches/libvnc-CVE-2018-20750.patch \ - %D%/packages/patches/libvnc-CVE-2019-15681.patch \ %D%/packages/patches/libvpx-CVE-2016-2818.patch \ %D%/packages/patches/libxslt-generated-ids.patch \ %D%/packages/patches/libxt-guix-search-paths.patch \ diff --git a/gnu/packages/patches/libvnc-CVE-2018-20750.patch b/gnu/packages/patches/libvnc-CVE-2018-20750.patch deleted file mode 100644 index 146243670a..0000000000 --- a/gnu/packages/patches/libvnc-CVE-2018-20750.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 09e8fc02f59f16e2583b34fe1a270c238bd9ffec Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Mon, 7 Jan 2019 10:40:01 +0100 -Subject: [PATCH] Limit lenght to INT_MAX bytes in - rfbProcessFileTransferReadBuffer() - -This ammends 15bb719c03cc70f14c36a843dcb16ed69b405707 fix for a heap -out-of-bound write access in rfbProcessFileTransferReadBuffer() when -reading a transfered file content in a server. The former fix did not -work on platforms with a 32-bit int type (expected by rfbReadExact()). - -CVE-2018-15127 - - ---- - libvncserver/rfbserver.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c -index 7af84906..f2edbeea 100644 ---- a/libvncserver/rfbserver.c -+++ b/libvncserver/rfbserver.c -@@ -88,6 +88,8 @@ - #include - /* strftime() */ - #include -+/* INT_MAX */ -+#include - - #ifdef LIBVNCSERVER_WITH_WEBSOCKETS - #include "rfbssl.h" -@@ -1472,8 +1474,11 @@ char *rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length) - 0XFFFFFFFF, i.e. SIZE_MAX for 32-bit systems. On 64-bit systems, a length of 0XFFFFFFFF - will safely be allocated since this check will never trigger and malloc() can digest length+1 - without problems as length is a uint32_t. -+ We also later pass length to rfbReadExact() that expects a signed int type and -+ that might wrap on platforms with a 32-bit int type if length is bigger -+ than 0X7FFFFFFF. - */ -- if(length == SIZE_MAX) { -+ if(length == SIZE_MAX || length > INT_MAX) { - rfbErr("rfbProcessFileTransferReadBuffer: too big file transfer length requested: %u", (unsigned int)length); - rfbCloseClient(cl); - return NULL; diff --git a/gnu/packages/patches/libvnc-CVE-2019-15681.patch b/gnu/packages/patches/libvnc-CVE-2019-15681.patch deleted file mode 100644 index e328d87920..0000000000 --- a/gnu/packages/patches/libvnc-CVE-2019-15681.patch +++ /dev/null @@ -1,23 +0,0 @@ -From d01e1bb4246323ba6fcee3b82ef1faa9b1dac82a Mon Sep 17 00:00:00 2001 -From: Christian Beier -Date: Mon, 19 Aug 2019 22:32:25 +0200 -Subject: [PATCH] rfbserver: don't leak stack memory to the remote - -Thanks go to Pavel Cheremushkin of Kaspersky for reporting. ---- - libvncserver/rfbserver.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c -index 3bacc891..310e5487 100644 ---- a/libvncserver/rfbserver.c -+++ b/libvncserver/rfbserver.c -@@ -3724,6 +3724,8 @@ rfbSendServerCutText(rfbScreenInfoPtr rfbScreen,char *str, int len) - rfbServerCutTextMsg sct; - rfbClientIteratorPtr iterator; - -+ memset((char *)&sct, 0, sizeof(sct)); -+ - iterator = rfbGetClientIterator(rfbScreen); - while ((cl = rfbClientIteratorNext(iterator)) != NULL) { - sct.type = rfbServerCutText; diff --git a/gnu/packages/vnc.scm b/gnu/packages/vnc.scm index a084b30f59..ab89bad7aa 100644 --- a/gnu/packages/vnc.scm +++ b/gnu/packages/vnc.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2019 Todor Kondić ;;; Copyright © 2020 Oleg Pykhalov ;;; Copyright © 2020 Hartmut Goebel +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -233,7 +234,7 @@ where the server is installed."))) (define-public libvnc (package (name "libvnc") - (version "0.9.12") + (version "0.9.13") (source (origin (method git-fetch) @@ -242,10 +243,16 @@ where the server is installed."))) (commit (string-append "LibVNCServer-" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1226hb179l914919f5nm2mlf8rhaarqbf48aa649p4rwmghyx9vm")) - (patches (search-patches "libvnc-CVE-2018-20750.patch" - "libvnc-CVE-2019-15681.patch")))) + (base32 "0zz0hslw8b1p3crnfy3xnmrljik359h83dpk64s697dqdcrzy141")))) (build-system cmake-build-system) + (arguments + '(#:phases (modify-phases %standard-phases + (add-after 'unpack 'patch-cc-reference + (lambda _ + (substitute* "test/includetest.sh" + (("^cc -I") + "gcc -I")) + #t))))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs -- cgit v1.2.3 From f3130c6674bb3941be6001bdcbca9f33bb2677e8 Mon Sep 17 00:00:00 2001 From: "B. Wilson" Date: Thu, 28 May 2020 07:32:28 +0900 Subject: gnu: Add intel-xed. * gnu/packages/assembly.scm (intel-xed): New variable. * gnu/packages/patches/intel-xed-fix-nondeterminism.patch: New file. * gnu/local.mk (dist_patch_DATA): Add reference to new patch. Signed-off-by: Marius Bakke --- gnu/local.mk | 1 + gnu/packages/assembly.scm | 94 +++++++++++++++++ .../patches/intel-xed-fix-nondeterminism.patch | 113 +++++++++++++++++++++ 3 files changed, 208 insertions(+) create mode 100644 gnu/packages/patches/intel-xed-fix-nondeterminism.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 570e6a3b49..d6de376e8e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1134,6 +1134,7 @@ dist_patch_DATA = \ %D%/packages/patches/ilmbase-fix-tests.patch \ %D%/packages/patches/inetutils-hurd.patch \ %D%/packages/patches/inkscape-poppler-0.76.patch \ + %D%/packages/patches/intel-xed-fix-nondeterminism.patch \ %D%/packages/patches/intltool-perl-compatibility.patch \ %D%/packages/patches/iputils-libcap-compat.patch \ %D%/packages/patches/irrlicht-use-system-libs.patch \ diff --git a/gnu/packages/assembly.scm b/gnu/packages/assembly.scm index 50b64a7f65..cd02541514 100644 --- a/gnu/packages/assembly.scm +++ b/gnu/packages/assembly.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2019 Andy Tai ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020 Christopher Lemmer Webber +;;; Copyright © 2020 B. Wilson ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +48,7 @@ #:use-module (gnu packages texinfo) #:use-module (gnu packages python) #:use-module (gnu packages sphinx) + #:use-module (gnu packages shells) #:use-module (gnu packages xml) #:use-module ((guix utils) #:select (%current-system))) @@ -405,3 +407,95 @@ Allegrex and RSP instruction sets, partial support for the EmotionEngine instruction set, as well as complete support for the ARM7 and ARM9 instruction sets, both THUMB and ARM mode.") (license license:expat))) + +(define-public intel-xed + (package + (name "intel-xed") + (version "11.2.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/intelxed/xed") + (commit version))) + (sha256 (base32 "1jffayski2gpd54vaska7fmiwnnia8v3cka4nfyzjgl8xsky9v2s")) + (file-name (git-file-name name version)) + (patches (search-patches "intel-xed-fix-nondeterminism.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("python-wrapper" ,python-wrapper) + ("tcsh" ,tcsh) + ;; As of the time of writing this comment, mbuild does not exist in the + ;; Python Package Index and seems to only be used by intel-xed, so we + ;; opt to include it here instead of packaging separately. Note also + ;; that the git repository contains no version tags, so we directly + ;; reference the "version" variable from setup.py instead. + ("mbuild" + ,(let ((name "mbuild") + (version "0.2496")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/intelxed/mbuild.git") + (commit "5304b94361fccd830c0e2417535a866b79c1c297"))) + (sha256 + (base32 + "0r3avc3035aklqxcnc14rlmmwpj3jp09vbcbwynhvvmcp8srl7dl")) + (file-name (git-file-name name version))))))) + (outputs '("out" "lib")) + (arguments + `(#:phases + ;; Upstream uses the custom Python build tool `mbuild', so we munge + ;; gnu-build-system to fit. The build process for this package is + ;; documented at https://intelxed.github.io/build-manual/. + (let* ((build-dir "build") + (kit-dir "kit")) + (modify-phases %standard-phases + (delete 'configure) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (let ((mbuild (assoc-ref inputs "mbuild"))) + (setenv "PYTHONPATH" (string-append + (getenv "PYTHONPATH") ":" mbuild)) + (invoke "./mfile.py" + (string-append "--build-dir=" build-dir) + (string-append "--install-dir=" kit-dir) + "examples" + "doc" + "install")))) + (replace 'check + (lambda _ + ;; Skip broken test group `tests/tests-avx512pf'. + (invoke "tests/run-cmd.py" + (string-append "--build-dir=" kit-dir "/bin") + "--tests" "tests/tests-base" + "--tests" "tests/tests-avx512" + "--tests" "tests/tests-cet" + "--tests" "tests/tests-via" + "--tests" "tests/tests-syntax" + "--tests" "tests/tests-xop"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (assoc-ref outputs "lib"))) + (copy-recursively (string-append kit-dir "/bin") + (string-append out "/bin")) + (copy-recursively (string-append kit-dir "/include") + (string-append lib "/include")) + (copy-recursively (string-append kit-dir "/lib") + (string-append lib "/lib")) + #t))))))) + (home-page "https://intelxed.github.io/") + (synopsis "Encoder and decoder for x86 (IA32 and Intel64) instructions") + (description "The Intel X86 Encoder Decoder (XED) is a software library and +for encoding and decoding X86 (IA32 and Intel64) instructions. The decoder +takes sequences of 1-15 bytes along with machine mode information and produces +a data structure describing the opcode, operands, and flags. The encoder takes +a similar data structure and produces a sequence of 1 to 15 bytes. Disassembly +is essentially a printing pass on the data structure. + +The library and development files are under the @code{lib} output, with a +family of command line utility wrappers in the default output. Each of the cli +tools is named like @code{xed*}. Documentation for the cli tools is sparse, so +this is a case where ``the code is the documentation.''") + (license license:asl2.0))) diff --git a/gnu/packages/patches/intel-xed-fix-nondeterminism.patch b/gnu/packages/patches/intel-xed-fix-nondeterminism.patch new file mode 100644 index 0000000000..c81bd0edde --- /dev/null +++ b/gnu/packages/patches/intel-xed-fix-nondeterminism.patch @@ -0,0 +1,113 @@ +This patch removes sources of build non-determinism in the upstream sources. + +In particular, many of the compiled sources are generated with Python code, +which in turn uses dictionaries to index the output C functions. However, +iterators over Python dictionaries have no guaranteed order, thus resulting in +the C functions being output in a random order between builds. + +The patch below fixes this by forcing an order during output in several key +places. Note, however, that future updates may uncover new such places that +just happen to be non-problematic at the time of this patch. If you are +reading this due to finding such issues, feel free to contact me at +elaexuotee@wilsonb.com for help. + +diff --git a/pysrc/ild_codegen.py b/pysrc/ild_codegen.py +index 628ec45..a9bff79 100755 +--- a/pysrc/ild_codegen.py ++++ b/pysrc/ild_codegen.py +@@ -188,14 +188,14 @@ def gen_l2_func_list(agi, target_nt_dict, arg_nt_dict, + ild_t_member): + """generate L2 functions""" + l2_func_list = [] +- for (nt_name,array) in target_nt_dict.items(): ++ for (nt_name,array) in sorted(target_nt_dict.items()): + target_opname = array.get_target_opname() + if array.is_const_lookup_fun(): + fo = gen_const_l2_function(agi, nt_name, + target_opname, ild_t_member) + l2_func_list.append(fo) + else: +- for arg_nt_seq,arg_arr in arg_nt_dict.items(): ++ for arg_nt_seq,arg_arr in sorted(arg_nt_dict.items()): + fo = gen_scalable_l2_function(agi, nt_name, + target_opname, ild_t_member, arg_arr, list(arg_nt_seq)) + l2_func_list.append(fo) +diff --git a/pysrc/ild_disp.py b/pysrc/ild_disp.py +index 942c036..cf80e29 100755 +--- a/pysrc/ild_disp.py ++++ b/pysrc/ild_disp.py +@@ -350,7 +350,8 @@ def work(agi, united_lookup, disp_nts, brdisp_nts, ild_gendir, + disp_dict = _gen_l3_array_dict(agi, disp_nts, _disp_token) + + +- nt_arr_list = list(brdisp_dict.values()) + list(disp_dict.values()) ++ nt_arr_list = ([v for (k,v) in sorted(brdisp_dict.items())] + ++ [v for (k,v) in sorted(disp_dict.items())]) + #create function that calls all initialization functions + init_f = ild_nt.gen_init_function(nt_arr_list, 'xed_ild_disp_l3_init') + +@@ -367,7 +368,7 @@ def work(agi, united_lookup, disp_nts, brdisp_nts, ild_gendir, + l2_functions = [] + eosz_op = ild_eosz.get_target_opname() + easz_op = ild_easz.get_target_opname() +- for nt_name,array in list(disp_dict.items()) + list(brdisp_dict.items()): ++ for nt_name,array in sorted(disp_dict.items()) + sorted(brdisp_dict.items()): + #Some DISP NTs depend on EOSZ, others on EASZ, we need to know + #that when we generate L2 functions + if eosz_op in array.get_arg_names(): +diff --git a/pysrc/ild_easz.py b/pysrc/ild_easz.py +index 02cd691..c53b9f2 100755 +--- a/pysrc/ild_easz.py ++++ b/pysrc/ild_easz.py +@@ -165,9 +165,10 @@ def work(agi, united_lookup, easz_nts, ild_gendir, debug): + return + nt_seq_arrays[tuple(nt_seq)] = array + #init function calls all single init functions for the created tables +- init_f = ild_nt.gen_init_function(list(nt_seq_arrays.values()), ++ nt_seq_values = [v for (k,v) in sorted(nt_seq_arrays.items())] ++ init_f = ild_nt.gen_init_function(nt_seq_values, + 'xed_ild_easz_init') +- ild_nt.dump_lu_arrays(agi, list(nt_seq_arrays.values()), _easz_c_fn, ++ ild_nt.dump_lu_arrays(agi, nt_seq_values, _easz_c_fn, + mbuild.join('include-private', _easz_header_fn), + init_f) + getter_fos = [] +diff --git a/pysrc/ild_eosz.py b/pysrc/ild_eosz.py +index 6643bc3..89d2d89 100755 +--- a/pysrc/ild_eosz.py ++++ b/pysrc/ild_eosz.py +@@ -200,10 +200,11 @@ def work(agi, united_lookup, eosz_nts, ild_gendir, debug): + return None + nt_seq_arrays[tuple(nt_seq)] = array + #init function calls all single init functions for the created tables +- init_f = ild_nt.gen_init_function(list(nt_seq_arrays.values()), ++ nt_seq_values = [v for (k,v) in sorted(nt_seq_arrays.items())] ++ init_f = ild_nt.gen_init_function(nt_seq_values, + 'xed_ild_eosz_init') + #dump init and lookup functions for EOSZ sequences +- ild_nt.dump_lu_arrays(agi, list(nt_seq_arrays.values()), _eosz_c_fn, ++ ild_nt.dump_lu_arrays(agi, nt_seq_values, _eosz_c_fn, + mbuild.join('include-private', _eosz_header_fn), + init_f) + #generate EOSZ getter functions - they get xed_decoded_inst_t* +diff --git a/pysrc/ild_imm.py b/pysrc/ild_imm.py +index 51c413c..0530bae 100755 +--- a/pysrc/ild_imm.py ++++ b/pysrc/ild_imm.py +@@ -322,12 +322,14 @@ def work(agi, united_lookup, imm_nts, ild_gendir, eosz_dict, + level='l3') + nt_dict[nt_name] = array + ++ nt_dict_values = [v for (k,v) in sorted(nt_dict.items())] ++ + #create function that calls all initialization functions for L3 +- init_f = ild_nt.gen_init_function(list(nt_dict.values()), ++ init_f = ild_nt.gen_init_function(nt_dict_values, + 'xed_ild_imm_l3_init') + + #dump L3 functions +- ild_nt.dump_lu_arrays(agi, list(nt_dict.values()), _l3_c_fn, ++ ild_nt.dump_lu_arrays(agi, nt_dict_values, _l3_c_fn, + mbuild.join('include-private',_l3_header_fn), + init_f) + -- cgit v1.2.3 From 7dcf5296730ea5d675397b79900899cf515245a8 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 22 Jul 2020 12:20:24 +0200 Subject: arb: Update to 2.18.1. * gnu/packages/patches/arb-flint-2.6.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/algebra.scm (arb): Update to 2.18.1. [source](patches): Remove. --- gnu/local.mk | 3 +- gnu/packages/algebra.scm | 5 ++-- gnu/packages/patches/arb-flint-2.6.patch | 48 -------------------------------- 3 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 gnu/packages/patches/arb-flint-2.6.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d6de376e8e..a1bd6a644a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1,6 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès -# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Andreas Enge +# Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Andreas Enge # Copyright © 2016 Mathieu Lirzin # Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver # Copyright © 2016 Chris Marusich @@ -775,7 +775,6 @@ dist_patch_DATA = \ %D%/packages/patches/antlr3-3_1-fix-java8-compilation.patch \ %D%/packages/patches/antlr3-3_3-fix-java8-compilation.patch \ %D%/packages/patches/apr-skip-getservbyname-test.patch \ - %D%/packages/patches/arb-flint-2.6.patch \ %D%/packages/patches/aspell-default-dict-dir.patch \ %D%/packages/patches/ath9k-htc-firmware-binutils.patch \ %D%/packages/patches/ath9k-htc-firmware-gcc.patch \ diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index d12c28262b..0da33a0156 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -495,7 +495,7 @@ fast arithmetic.") (define-public arb (package (name "arb") - (version "2.17.0") + (version "2.18.1") (source (origin (method git-fetch) (uri (git-reference @@ -504,8 +504,7 @@ fast arithmetic.") (file-name (git-file-name name version)) (sha256 (base32 - "05lpy3hkl5f8ik19aw40cqydrb932xaf2n8hbq9ib5dnk7f010p1")) - (patches (search-patches "arb-flint-2.6.patch")))) + "15fx3dcbzgwddw9p1nysmx0dbh058afv5m8cj5pdjkcmcl7kw7z9")))) (build-system gnu-build-system) (propagated-inputs `(("flint" ,flint))) ; flint.h is included by arf.h diff --git a/gnu/packages/patches/arb-flint-2.6.patch b/gnu/packages/patches/arb-flint-2.6.patch deleted file mode 100644 index 98ff5e95b4..0000000000 --- a/gnu/packages/patches/arb-flint-2.6.patch +++ /dev/null @@ -1,48 +0,0 @@ -From d3d9983231e0f034e86a1e75761627eb8213b704 Mon Sep 17 00:00:00 2001 -From: fredrik -Date: Wed, 29 Apr 2020 13:41:36 +0200 -Subject: [PATCH] handle flint incompatibilities - ---- - fmpr.h | 4 ++++ - fmpz_extras.h | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/fmpr.h b/fmpr.h -index 2204d72e..c6a8c342 100644 ---- a/fmpr.h -+++ b/fmpr.h -@@ -22,7 +22,11 @@ - #include "flint/flint.h" - #include "flint/fmpz.h" - #include "flint/fmpq.h" -+#if __FLINT_RELEASE < 20600 - #include "flint/config.h" -+#else -+#include "flint/flint-config.h" -+#endif - #include "fmpz_extras.h" - - #ifndef flint_abort -diff --git a/fmpz_extras.h b/fmpz_extras.h -index 4fd0538f..486e28c8 100644 ---- a/fmpz_extras.h -+++ b/fmpz_extras.h -@@ -43,6 +43,8 @@ fmpz_add_inline(fmpz_t z, const fmpz_t x, const fmpz_t y) - fmpz_add(z, x, y); - } - -+#if __FLINT_RELEASE < 20600 -+ - static __inline__ void - fmpz_add_si(fmpz_t z, const fmpz_t x, slong y) - { -@@ -61,6 +63,8 @@ fmpz_sub_si(fmpz_t z, const fmpz_t x, slong y) - fmpz_add_ui(z, x, -y); - } - -+#endif -+ - static __inline__ void - fmpz_add_si_inline(fmpz_t z, const fmpz_t x, slong y) - { -- cgit v1.2.3 From ceaeae8f066998026b43557f58994f7711e299a4 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 23 Jul 2020 00:23:50 -0400 Subject: gnu: linux-libre@4.14: Update to 4.14.189. * gnu/packages/linux.scm (linux-libre-4.14-version): Update to 4.14.189. (linux-libre-4.14-pristine-source): Update hash. (linux-libre-4.14-source): Remove %linux-libre-fix-atheros-9271-patch. (deblob-scripts-4.14): Update to 4.14.189. (%linux-libre-fix-atheros-9271-patch): Delete variable. * gnu/packages/patches/linux-libre-fix-atheros-9271.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/linux.scm | 12 +- .../patches/linux-libre-fix-atheros-9271.patch | 225 --------------------- 3 files changed, 4 insertions(+), 234 deletions(-) delete mode 100644 gnu/packages/patches/linux-libre-fix-atheros-9271.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3eee908752..447b9c3d4c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1253,7 +1253,6 @@ dist_patch_DATA = \ %D%/packages/patches/linbox-fix-pkgconfig.patch \ %D%/packages/patches/linkchecker-tests-require-network.patch \ %D%/packages/patches/linphoneqt-tabbutton.patch \ - %D%/packages/patches/linux-libre-fix-atheros-9271.patch \ %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \ %D%/packages/patches/linux-pam-no-setfsuid.patch \ %D%/packages/patches/lirc-localstatedir.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b3065c13bd..a1e18ba834 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -218,7 +218,7 @@ defconfig. Return the appropriate make target if applicable, otherwise return (define deblob-scripts-4.14 (linux-libre-deblob-scripts - "4.14.188" + "4.14.189" (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6") (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky"))) @@ -399,10 +399,10 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." (%upstream-linux-source version hash) deblob-scripts-4.19))) -(define-public linux-libre-4.14-version "4.14.188") +(define-public linux-libre-4.14-version "4.14.189") (define-public linux-libre-4.14-pristine-source (let ((version linux-libre-4.14-version) - (hash (base32 "0jq6cyxa0mxnvd33gi66a4x3xlfsih2aaifa6yyvgldihw9y0vvn"))) + (hash (base32 "1qgr6hb714xi7rav4za4vk4l7c0ma3ndf0f2ca3q8ly5gd2j3rd7"))) (make-linux-libre-source version (%upstream-linux-source version hash) deblob-scripts-4.14))) @@ -445,9 +445,6 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." (sha256 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f")))) -(define %linux-libre-fix-atheros-9271-patch - (search-patch "linux-libre-fix-atheros-9271.patch")) - (define (source-with-patches source patches) (origin (inherit source) @@ -475,8 +472,7 @@ corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." (define-public linux-libre-4.14-source (source-with-patches linux-libre-4.14-pristine-source - (list %boot-logo-patch - %linux-libre-fix-atheros-9271-patch))) + (list %boot-logo-patch))) (define-public linux-libre-4.9-source (source-with-patches linux-libre-4.9-pristine-source diff --git a/gnu/packages/patches/linux-libre-fix-atheros-9271.patch b/gnu/packages/patches/linux-libre-fix-atheros-9271.patch deleted file mode 100644 index 7527f9fdf0..0000000000 --- a/gnu/packages/patches/linux-libre-fix-atheros-9271.patch +++ /dev/null @@ -1,225 +0,0 @@ -Revert the following upstream commit, which broke Atheros 9271 support. -See: - https://bugzilla.kernel.org/show_bug.cgi?id=208251 - https://bugzilla.redhat.com/show_bug.cgi?id=1848631 - - -From b5c8896bc14f54e5c4dd5a6e42879f125b8abd2d Mon Sep 17 00:00:00 2001 -From: Qiujun Huang -Date: Sat, 4 Apr 2020 12:18:38 +0800 -Subject: ath9k: Fix general protection fault in ath9k_hif_usb_rx_cb - -commit 2bbcaaee1fcbd83272e29f31e2bb7e70d8c49e05 upstream. - -In ath9k_hif_usb_rx_cb interface number is assumed to be 0. -usb_ifnum_to_if(urb->dev, 0) -But it isn't always true. - -The case reported by syzbot: -https://lore.kernel.org/linux-usb/000000000000666c9c05a1c05d12@google.com -usb 2-1: new high-speed USB device number 2 using dummy_hcd -usb 2-1: config 1 has an invalid interface number: 2 but max is 0 -usb 2-1: config 1 has no interface number 0 -usb 2-1: New USB device found, idVendor=0cf3, idProduct=9271, bcdDevice= -1.08 -usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 -general protection fault, probably for non-canonical address -0xdffffc0000000015: 0000 [#1] SMP KASAN -KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af] -CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0-rc5-syzkaller #0 - -Call Trace -__usb_hcd_giveback_urb+0x29a/0x550 drivers/usb/core/hcd.c:1650 -usb_hcd_giveback_urb+0x368/0x420 drivers/usb/core/hcd.c:1716 -dummy_timer+0x1258/0x32ae drivers/usb/gadget/udc/dummy_hcd.c:1966 -call_timer_fn+0x195/0x6f0 kernel/time/timer.c:1404 -expire_timers kernel/time/timer.c:1449 [inline] -__run_timers kernel/time/timer.c:1773 [inline] -__run_timers kernel/time/timer.c:1740 [inline] -run_timer_softirq+0x5f9/0x1500 kernel/time/timer.c:1786 -__do_softirq+0x21e/0x950 kernel/softirq.c:292 -invoke_softirq kernel/softirq.c:373 [inline] -irq_exit+0x178/0x1a0 kernel/softirq.c:413 -exiting_irq arch/x86/include/asm/apic.h:546 [inline] -smp_apic_timer_interrupt+0x141/0x540 arch/x86/kernel/apic/apic.c:1146 -apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:829 - -Reported-and-tested-by: syzbot+40d5d2e8a4680952f042@syzkaller.appspotmail.com -Signed-off-by: Qiujun Huang -Signed-off-by: Kalle Valo -Link: https://lore.kernel.org/r/20200404041838.10426-6-hqjagain@gmail.com -Signed-off-by: Greg Kroah-Hartman ---- - drivers/net/wireless/ath/ath9k/hif_usb.c | 48 ++++++++++++++++++++++++-------- - drivers/net/wireless/ath/ath9k/hif_usb.h | 5 ++++ - 2 files changed, 42 insertions(+), 11 deletions(-) - -diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c -index 6049d3766c64..4ed21dad6a8e 100644 ---- b/drivers/net/wireless/ath/ath9k/hif_usb.c -+++ a/drivers/net/wireless/ath/ath9k/hif_usb.c -@@ -643,9 +643,9 @@ - - static void ath9k_hif_usb_rx_cb(struct urb *urb) - { -- struct rx_buf *rx_buf = (struct rx_buf *)urb->context; -- struct hif_device_usb *hif_dev = rx_buf->hif_dev; -- struct sk_buff *skb = rx_buf->skb; -+ struct sk_buff *skb = (struct sk_buff *) urb->context; -+ struct hif_device_usb *hif_dev = -+ usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); - int ret; - - if (!skb) -@@ -685,15 +685,14 @@ - return; - free: - kfree_skb(skb); -- kfree(rx_buf); - } - - static void ath9k_hif_usb_reg_in_cb(struct urb *urb) - { -- struct rx_buf *rx_buf = (struct rx_buf *)urb->context; -- struct hif_device_usb *hif_dev = rx_buf->hif_dev; -- struct sk_buff *skb = rx_buf->skb; -+ struct sk_buff *skb = (struct sk_buff *) urb->context; - struct sk_buff *nskb; -+ struct hif_device_usb *hif_dev = -+ usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); - int ret; - - if (!skb) -@@ -751,7 +750,6 @@ - return; - free: - kfree_skb(skb); -- kfree(rx_buf); - urb->context = NULL; - } - -@@ -797,7 +795,7 @@ - init_usb_anchor(&hif_dev->mgmt_submitted); - - for (i = 0; i < MAX_TX_URB_NUM; i++) { -- tx_buf = kzalloc(sizeof(*tx_buf), GFP_KERNEL); -+ tx_buf = kzalloc(sizeof(struct tx_buf), GFP_KERNEL); - if (!tx_buf) - goto err; - -@@ -834,9 +832,8 @@ - - static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev) - { -- struct rx_buf *rx_buf = NULL; -+ struct urb *urb = NULL; - struct sk_buff *skb = NULL; -- struct urb *urb = NULL; - int i, ret; - - init_usb_anchor(&hif_dev->rx_submitted); -@@ -844,12 +841,6 @@ - - for (i = 0; i < MAX_RX_URB_NUM; i++) { - -- rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); -- if (!rx_buf) { -- ret = -ENOMEM; -- goto err_rxb; -- } -- - /* Allocate URB */ - urb = usb_alloc_urb(0, GFP_KERNEL); - if (urb == NULL) { -@@ -864,14 +855,11 @@ - goto err_skb; - } - -- rx_buf->hif_dev = hif_dev; -- rx_buf->skb = skb; -- - usb_fill_bulk_urb(urb, hif_dev->udev, - usb_rcvbulkpipe(hif_dev->udev, - USB_WLAN_RX_PIPE), - skb->data, MAX_RX_BUF_SIZE, -- ath9k_hif_usb_rx_cb, rx_buf); -+ ath9k_hif_usb_rx_cb, skb); - - /* Anchor URB */ - usb_anchor_urb(urb, &hif_dev->rx_submitted); -@@ -897,8 +885,6 @@ - err_skb: - usb_free_urb(urb); - err_urb: -- kfree(rx_buf); --err_rxb: - ath9k_hif_usb_dealloc_rx_urbs(hif_dev); - return ret; - } -@@ -910,21 +896,14 @@ - - static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev) - { -- struct rx_buf *rx_buf = NULL; -+ struct urb *urb = NULL; - struct sk_buff *skb = NULL; -- struct urb *urb = NULL; - int i, ret; - - init_usb_anchor(&hif_dev->reg_in_submitted); - - for (i = 0; i < MAX_REG_IN_URB_NUM; i++) { - -- rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL); -- if (!rx_buf) { -- ret = -ENOMEM; -- goto err_rxb; -- } -- - /* Allocate URB */ - urb = usb_alloc_urb(0, GFP_KERNEL); - if (urb == NULL) { -@@ -939,14 +918,11 @@ - goto err_skb; - } - -- rx_buf->hif_dev = hif_dev; -- rx_buf->skb = skb; -- - usb_fill_int_urb(urb, hif_dev->udev, - usb_rcvintpipe(hif_dev->udev, - USB_REG_IN_PIPE), - skb->data, MAX_REG_IN_BUF_SIZE, -- ath9k_hif_usb_reg_in_cb, rx_buf, 1); -+ ath9k_hif_usb_reg_in_cb, skb, 1); - - /* Anchor URB */ - usb_anchor_urb(urb, &hif_dev->reg_in_submitted); -@@ -972,8 +948,6 @@ - err_skb: - usb_free_urb(urb); - err_urb: -- kfree(rx_buf); --err_rxb: - ath9k_hif_usb_dealloc_reg_in_urbs(hif_dev); - return ret; - } -diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.h b/drivers/net/wireless/ath/ath9k/hif_usb.h -index a94e7e1c86e9..5985aa15ca93 100644 ---- b/drivers/net/wireless/ath/ath9k/hif_usb.h -+++ a/drivers/net/wireless/ath/ath9k/hif_usb.h -@@ -86,11 +86,6 @@ - struct list_head list; - }; - --struct rx_buf { -- struct sk_buff *skb; -- struct hif_device_usb *hif_dev; --}; -- - #define HIF_USB_TX_STOP BIT(0) - #define HIF_USB_TX_FLUSH BIT(1) - -+- -cgit 1.2.3-1.el7 - -- cgit v1.2.3 From 5f63905096e456097fca206f56ce9257f72faf64 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 22 Jul 2020 13:47:39 -0400 Subject: gnu: Fix Krita. Fixes . Reported by linka on #guix. * gnu/packages/patches/qtbase-fix-krita-deadlock.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/kde.scm (qtbase-for-krita): New variable. (krita)[inputs]: Replace qtbase with qtbase-for-krita. --- gnu/local.mk | 1 + gnu/packages/kde.scm | 10 +- .../patches/qtbase-fix-krita-deadlock.patch | 110 +++++++++++++++++++++ gnu/packages/qt.scm | 1 + 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/qtbase-fix-krita-deadlock.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 139c17e751..2c0d5076d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1489,6 +1489,7 @@ dist_patch_DATA = \ %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ %D%/packages/patches/qtbase-absolute-runpath.patch \ + %D%/packages/patches/qtbase-fix-krita-deadlock.patch \ %D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \ %D%/packages/patches/qtbase-use-TZDIR.patch \ %D%/packages/patches/qtscript-disable-tests.patch \ diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm index 9a80e362b6..9fa8ed7c15 100644 --- a/gnu/packages/kde.scm +++ b/gnu/packages/kde.scm @@ -360,6 +360,14 @@ a module for implementing ODF Gantt charts, which are bar charts that illustrate project schedules.") (license license:gpl2+))) +(define qtbase-for-krita + (package + (inherit qtbase) + (source (origin + (inherit (package-source qtbase)) + (patches (append (origin-patches (package-source qtbase)) + (search-patches "qtbase-fix-krita-deadlock.patch"))))))) + (define-public krita (package (name "krita") @@ -434,7 +442,7 @@ illustrate project schedules.") ("openexr" ,openexr) ("perl" ,perl) ("poppler-qt5" ,poppler-qt5) - ("qtbase" ,qtbase) + ("qtbase" ,qtbase-for-krita) ("qtdeclarative" ,qtdeclarative) ("qtmultimedia" ,qtmultimedia) ("qtsvg" ,qtsvg) diff --git a/gnu/packages/patches/qtbase-fix-krita-deadlock.patch b/gnu/packages/patches/qtbase-fix-krita-deadlock.patch new file mode 100644 index 0000000000..d3554be3c9 --- /dev/null +++ b/gnu/packages/patches/qtbase-fix-krita-deadlock.patch @@ -0,0 +1,110 @@ +Fix a deadlock in Krita: + +https://bugreports.qt.io/browse/QTBUG-83207 + +Patch copied from Qt bug tracker: + +https://codereview.qt-project.org/c/qt/qtbase/+/296034 + +From 276fa8383a7535765be7182883ef4aade17ce013 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Thu, 02 Apr 2020 12:08:41 -0300 +Subject: [PATCH] QLibrary: fix deadlock caused by fix to QTBUG-39642 + +Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around +the entire load_sys(). We had reasoed that deadlocks would only occur if +the object creation in instance() recursed into its own instance(), +which was already a bug. But we had forgotten that dlopen()/ +LoadLibrary() executes initialization code from the module being loaded, +which could cause a recursion back into the same QPluginLoader or +QLibrary object. This recursion is benign because the module *is* loaded +and dlopen()/LoadLibrary() returns the same handle. + +[ChangeLog][QtCore][QLibrary and QPluginLoader] Fixed a deadlock that +would happen if the plugin or library being loaded has load-time +initialization code (C++ global variables) that recursed back into the +same QLibrary or QPluginLoader object. + +PS: QLibraryPrivate::loadPlugin() updates pluginState outside a mutex +lock, so pluginState should be made an atomic variable. Once that is +done, we'll only need locking the mutex to update errorString (no +locking before loading). + +Fixes: QTBUG-83207 +Task-number: QTBUG-39642 +Change-Id: Ibdc95e9af7bd456a94ecfffd160209304e5ab2eb +Reviewed-by: Volker Hilsheimer +Reviewed-by: David Faure +--- + +diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp +index ddb053c..be9d92b 100644 +--- a/src/corelib/plugin/qlibrary.cpp ++++ b/src/corelib/plugin/qlibrary.cpp +@@ -576,9 +576,7 @@ + + Q_TRACE(QLibraryPrivate_load_entry, fileName); + +- mutex.lock(); + bool ret = load_sys(); +- mutex.unlock(); + if (qt_debug_component()) { + if (ret) { + qDebug() << "loaded library" << fileName; +diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp +index 017aa97..a5c72f8 100644 +--- a/src/corelib/plugin/qlibrary_unix.cpp ++++ b/src/corelib/plugin/qlibrary_unix.cpp +@@ -123,6 +123,7 @@ + + bool QLibraryPrivate::load_sys() + { ++ QMutexLocker locker(&mutex); + QString attempt; + QFileSystemEntry fsEntry(fileName); + +@@ -213,6 +214,7 @@ + } + #endif + ++ locker.unlock(); + bool retry = true; + Handle hnd = nullptr; + for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) { +@@ -273,6 +275,8 @@ + } + } + #endif ++ ++ locker.relock(); + if (!hnd) { + errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror()); + } +diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp +index 000bf76..ef58724 100644 +--- a/src/corelib/plugin/qlibrary_win.cpp ++++ b/src/corelib/plugin/qlibrary_win.cpp +@@ -78,6 +78,7 @@ + // fileName + // + // NB If it's a plugin we do not ever try the ".dll" extension ++ QMutexLocker locker(&mutex); + QStringList attempts; + + if (pluginState != IsAPlugin) +@@ -95,6 +96,7 @@ + attempts.prepend(QDir::rootPath() + fileName); + #endif + ++ locker.unlock(); + Handle hnd = nullptr; + for (const QString &attempt : qAsConst(attempts)) { + #ifndef Q_OS_WINRT +@@ -115,6 +117,7 @@ + #ifndef Q_OS_WINRT + SetErrorMode(oldmode); + #endif ++ locker.relock(); + if (!hnd) { + errorString = QLibrary::tr("Cannot load library %1: %2").arg( + QDir::toNativeSeparators(fileName), qt_error_string()); diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 0cb36427a0..e0e71c595d 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -342,6 +342,7 @@ developers using C++ or QML, a CSS & JavaScript like language.") (define-public qtbase (package (name "qtbase") + ;; TODO Remove ((gnu packages kde) qtbase-for-krita) when upgrading qtbase. (version "5.14.2") (source (origin (method url-fetch) -- cgit v1.2.3 From e61b3bcd79a85babde19101118e9d51cd769fbbb Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Thu, 23 Jul 2020 16:53:52 -0400 Subject: Revert "gnu: Fix Krita." This reverts commit 5f63905096e456097fca206f56ce9257f72faf64. This commit caused `guix pull` to crash like this: ------ Backtrace: In ice-9/boot-9.scm: 222:29 19 (map1 _) 222:29 18 (map1 _) 222:29 17 (map1 _) 222:29 16 (map1 _) 222:17 15 (map1 (((gnu packages kde)) ((gnu packages libevent)) ((gnu packages libidn)) ((gnu packages #)) ((?)) ?)) 3297:17 14 (resolve-interface (gnu packages kde) #:select _ #:hide _ #:prefix _ #:renamer _ #:version _) In ice-9/threads.scm: 390:8 13 (_ _) In ice-9/boot-9.scm: 3223:13 12 (_) In ice-9/threads.scm: 390:8 11 (_ _) In ice-9/boot-9.scm: 3507:20 10 (_) 2806:4 9 (save-module-excursion _) 3527:26 8 (_) In unknown file: 7 (primitive-load-path "gnu/packages/kde" #) In ice-9/eval.scm: 626:19 6 (_ #) 293:34 5 (_ #) 173:47 4 (_ #(# #)) 159:9 3 (_ #(# #)) 191:35 2 (_ #(# #)) 223:20 1 (proc #(# #)) In unknown file: 0 (%resolve-variable (7 . qtbase) #) ERROR: In procedure %resolve-variable: error: qtbase: unbound variable ------ --- gnu/local.mk | 1 - gnu/packages/kde.scm | 10 +- .../patches/qtbase-fix-krita-deadlock.patch | 110 --------------------- gnu/packages/qt.scm | 1 - 4 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 gnu/packages/patches/qtbase-fix-krita-deadlock.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2c0d5076d3..139c17e751 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1489,7 +1489,6 @@ dist_patch_DATA = \ %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ %D%/packages/patches/qtbase-absolute-runpath.patch \ - %D%/packages/patches/qtbase-fix-krita-deadlock.patch \ %D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \ %D%/packages/patches/qtbase-use-TZDIR.patch \ %D%/packages/patches/qtscript-disable-tests.patch \ diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm index 9fa8ed7c15..9a80e362b6 100644 --- a/gnu/packages/kde.scm +++ b/gnu/packages/kde.scm @@ -360,14 +360,6 @@ a module for implementing ODF Gantt charts, which are bar charts that illustrate project schedules.") (license license:gpl2+))) -(define qtbase-for-krita - (package - (inherit qtbase) - (source (origin - (inherit (package-source qtbase)) - (patches (append (origin-patches (package-source qtbase)) - (search-patches "qtbase-fix-krita-deadlock.patch"))))))) - (define-public krita (package (name "krita") @@ -442,7 +434,7 @@ illustrate project schedules.") ("openexr" ,openexr) ("perl" ,perl) ("poppler-qt5" ,poppler-qt5) - ("qtbase" ,qtbase-for-krita) + ("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) ("qtmultimedia" ,qtmultimedia) ("qtsvg" ,qtsvg) diff --git a/gnu/packages/patches/qtbase-fix-krita-deadlock.patch b/gnu/packages/patches/qtbase-fix-krita-deadlock.patch deleted file mode 100644 index d3554be3c9..0000000000 --- a/gnu/packages/patches/qtbase-fix-krita-deadlock.patch +++ /dev/null @@ -1,110 +0,0 @@ -Fix a deadlock in Krita: - -https://bugreports.qt.io/browse/QTBUG-83207 - -Patch copied from Qt bug tracker: - -https://codereview.qt-project.org/c/qt/qtbase/+/296034 - -From 276fa8383a7535765be7182883ef4aade17ce013 Mon Sep 17 00:00:00 2001 -From: Thiago Macieira -Date: Thu, 02 Apr 2020 12:08:41 -0300 -Subject: [PATCH] QLibrary: fix deadlock caused by fix to QTBUG-39642 - -Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around -the entire load_sys(). We had reasoed that deadlocks would only occur if -the object creation in instance() recursed into its own instance(), -which was already a bug. But we had forgotten that dlopen()/ -LoadLibrary() executes initialization code from the module being loaded, -which could cause a recursion back into the same QPluginLoader or -QLibrary object. This recursion is benign because the module *is* loaded -and dlopen()/LoadLibrary() returns the same handle. - -[ChangeLog][QtCore][QLibrary and QPluginLoader] Fixed a deadlock that -would happen if the plugin or library being loaded has load-time -initialization code (C++ global variables) that recursed back into the -same QLibrary or QPluginLoader object. - -PS: QLibraryPrivate::loadPlugin() updates pluginState outside a mutex -lock, so pluginState should be made an atomic variable. Once that is -done, we'll only need locking the mutex to update errorString (no -locking before loading). - -Fixes: QTBUG-83207 -Task-number: QTBUG-39642 -Change-Id: Ibdc95e9af7bd456a94ecfffd160209304e5ab2eb -Reviewed-by: Volker Hilsheimer -Reviewed-by: David Faure ---- - -diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp -index ddb053c..be9d92b 100644 ---- a/src/corelib/plugin/qlibrary.cpp -+++ b/src/corelib/plugin/qlibrary.cpp -@@ -576,9 +576,7 @@ - - Q_TRACE(QLibraryPrivate_load_entry, fileName); - -- mutex.lock(); - bool ret = load_sys(); -- mutex.unlock(); - if (qt_debug_component()) { - if (ret) { - qDebug() << "loaded library" << fileName; -diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp -index 017aa97..a5c72f8 100644 ---- a/src/corelib/plugin/qlibrary_unix.cpp -+++ b/src/corelib/plugin/qlibrary_unix.cpp -@@ -123,6 +123,7 @@ - - bool QLibraryPrivate::load_sys() - { -+ QMutexLocker locker(&mutex); - QString attempt; - QFileSystemEntry fsEntry(fileName); - -@@ -213,6 +214,7 @@ - } - #endif - -+ locker.unlock(); - bool retry = true; - Handle hnd = nullptr; - for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) { -@@ -273,6 +275,8 @@ - } - } - #endif -+ -+ locker.relock(); - if (!hnd) { - errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror()); - } -diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp -index 000bf76..ef58724 100644 ---- a/src/corelib/plugin/qlibrary_win.cpp -+++ b/src/corelib/plugin/qlibrary_win.cpp -@@ -78,6 +78,7 @@ - // fileName - // - // NB If it's a plugin we do not ever try the ".dll" extension -+ QMutexLocker locker(&mutex); - QStringList attempts; - - if (pluginState != IsAPlugin) -@@ -95,6 +96,7 @@ - attempts.prepend(QDir::rootPath() + fileName); - #endif - -+ locker.unlock(); - Handle hnd = nullptr; - for (const QString &attempt : qAsConst(attempts)) { - #ifndef Q_OS_WINRT -@@ -115,6 +117,7 @@ - #ifndef Q_OS_WINRT - SetErrorMode(oldmode); - #endif -+ locker.relock(); - if (!hnd) { - errorString = QLibrary::tr("Cannot load library %1: %2").arg( - QDir::toNativeSeparators(fileName), qt_error_string()); diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index e0e71c595d..0cb36427a0 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -342,7 +342,6 @@ developers using C++ or QML, a CSS & JavaScript like language.") (define-public qtbase (package (name "qtbase") - ;; TODO Remove ((gnu packages kde) qtbase-for-krita) when upgrading qtbase. (version "5.14.2") (source (origin (method url-fetch) -- cgit v1.2.3 From 0448bfe2d769998ba33c288a07738e13b02113a4 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Wed, 22 Jul 2020 13:47:39 -0400 Subject: gnu: Fix Krita. Fixes . Reported by linka on #guix. * gnu/packages/patches/qtbase-fix-krita-deadlock.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/qt.scm (qtbase-for-krita): New variable. * gnu/packages/kde.scm (krita)[inputs]: Replace qtbase with qtbase-for-krita. --- gnu/local.mk | 1 + gnu/packages/kde.scm | 2 +- .../patches/qtbase-fix-krita-deadlock.patch | 110 +++++++++++++++++++++ gnu/packages/qt.scm | 10 ++ 4 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/qtbase-fix-krita-deadlock.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 139c17e751..2c0d5076d3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1489,6 +1489,7 @@ dist_patch_DATA = \ %D%/packages/patches/qrcodegen-cpp-make-install.patch \ %D%/packages/patches/qt4-ldflags.patch \ %D%/packages/patches/qtbase-absolute-runpath.patch \ + %D%/packages/patches/qtbase-fix-krita-deadlock.patch \ %D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch \ %D%/packages/patches/qtbase-use-TZDIR.patch \ %D%/packages/patches/qtscript-disable-tests.patch \ diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm index 9a80e362b6..333dd483cb 100644 --- a/gnu/packages/kde.scm +++ b/gnu/packages/kde.scm @@ -434,7 +434,7 @@ illustrate project schedules.") ("openexr" ,openexr) ("perl" ,perl) ("poppler-qt5" ,poppler-qt5) - ("qtbase" ,qtbase) + ("qtbase" ,qtbase-for-krita) ("qtdeclarative" ,qtdeclarative) ("qtmultimedia" ,qtmultimedia) ("qtsvg" ,qtsvg) diff --git a/gnu/packages/patches/qtbase-fix-krita-deadlock.patch b/gnu/packages/patches/qtbase-fix-krita-deadlock.patch new file mode 100644 index 0000000000..d3554be3c9 --- /dev/null +++ b/gnu/packages/patches/qtbase-fix-krita-deadlock.patch @@ -0,0 +1,110 @@ +Fix a deadlock in Krita: + +https://bugreports.qt.io/browse/QTBUG-83207 + +Patch copied from Qt bug tracker: + +https://codereview.qt-project.org/c/qt/qtbase/+/296034 + +From 276fa8383a7535765be7182883ef4aade17ce013 Mon Sep 17 00:00:00 2001 +From: Thiago Macieira +Date: Thu, 02 Apr 2020 12:08:41 -0300 +Subject: [PATCH] QLibrary: fix deadlock caused by fix to QTBUG-39642 + +Commit ae6f73e8566fa76470937aca737141183929a5ec inserted a mutex around +the entire load_sys(). We had reasoed that deadlocks would only occur if +the object creation in instance() recursed into its own instance(), +which was already a bug. But we had forgotten that dlopen()/ +LoadLibrary() executes initialization code from the module being loaded, +which could cause a recursion back into the same QPluginLoader or +QLibrary object. This recursion is benign because the module *is* loaded +and dlopen()/LoadLibrary() returns the same handle. + +[ChangeLog][QtCore][QLibrary and QPluginLoader] Fixed a deadlock that +would happen if the plugin or library being loaded has load-time +initialization code (C++ global variables) that recursed back into the +same QLibrary or QPluginLoader object. + +PS: QLibraryPrivate::loadPlugin() updates pluginState outside a mutex +lock, so pluginState should be made an atomic variable. Once that is +done, we'll only need locking the mutex to update errorString (no +locking before loading). + +Fixes: QTBUG-83207 +Task-number: QTBUG-39642 +Change-Id: Ibdc95e9af7bd456a94ecfffd160209304e5ab2eb +Reviewed-by: Volker Hilsheimer +Reviewed-by: David Faure +--- + +diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp +index ddb053c..be9d92b 100644 +--- a/src/corelib/plugin/qlibrary.cpp ++++ b/src/corelib/plugin/qlibrary.cpp +@@ -576,9 +576,7 @@ + + Q_TRACE(QLibraryPrivate_load_entry, fileName); + +- mutex.lock(); + bool ret = load_sys(); +- mutex.unlock(); + if (qt_debug_component()) { + if (ret) { + qDebug() << "loaded library" << fileName; +diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp +index 017aa97..a5c72f8 100644 +--- a/src/corelib/plugin/qlibrary_unix.cpp ++++ b/src/corelib/plugin/qlibrary_unix.cpp +@@ -123,6 +123,7 @@ + + bool QLibraryPrivate::load_sys() + { ++ QMutexLocker locker(&mutex); + QString attempt; + QFileSystemEntry fsEntry(fileName); + +@@ -213,6 +214,7 @@ + } + #endif + ++ locker.unlock(); + bool retry = true; + Handle hnd = nullptr; + for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) { +@@ -273,6 +275,8 @@ + } + } + #endif ++ ++ locker.relock(); + if (!hnd) { + errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror()); + } +diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp +index 000bf76..ef58724 100644 +--- a/src/corelib/plugin/qlibrary_win.cpp ++++ b/src/corelib/plugin/qlibrary_win.cpp +@@ -78,6 +78,7 @@ + // fileName + // + // NB If it's a plugin we do not ever try the ".dll" extension ++ QMutexLocker locker(&mutex); + QStringList attempts; + + if (pluginState != IsAPlugin) +@@ -95,6 +96,7 @@ + attempts.prepend(QDir::rootPath() + fileName); + #endif + ++ locker.unlock(); + Handle hnd = nullptr; + for (const QString &attempt : qAsConst(attempts)) { + #ifndef Q_OS_WINRT +@@ -115,6 +117,7 @@ + #ifndef Q_OS_WINRT + SetErrorMode(oldmode); + #endif ++ locker.relock(); + if (!hnd) { + errorString = QLibrary::tr("Cannot load library %1: %2").arg( + QDir::toNativeSeparators(fileName), qt_error_string()); diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index 0cb36427a0..1cbf7991ab 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -342,6 +342,7 @@ developers using C++ or QML, a CSS & JavaScript like language.") (define-public qtbase (package (name "qtbase") + ;; TODO Remove ((gnu packages kde) qtbase-for-krita) when upgrading qtbase. (version "5.14.2") (source (origin (method url-fetch) @@ -608,6 +609,15 @@ developers using C++ or QML, a CSS & JavaScript like language.") (patches (append (origin-patches (package-source qtbase)) (search-patches "qtbase-absolute-runpath.patch"))))))) +(define-public qtbase-for-krita + (hidden-package + (package + (inherit qtbase) + (source (origin + (inherit (package-source qtbase)) + (patches (append (origin-patches (package-source qtbase)) + (search-patches "qtbase-fix-krita-deadlock.patch")))))))) + (define-public qtsvg (package (inherit qtbase) (name "qtsvg") -- cgit v1.2.3 From beb7a28110cfd9f6a134421aade9adaba12d1baa Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 24 Jul 2020 13:58:33 +0200 Subject: gnu: luminance-hdr: Update to 2.6.0. * gnu/packages/patches/luminance-hdr-qt-printer.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/image-viewers.scm (luminance-hdr): Update to 2.6.0. [inputs]: Add QTSVG and EIGEN. [arguments]: Add #:tests? #f. --- gnu/local.mk | 1 - gnu/packages/image-viewers.scm | 10 ++++---- .../patches/luminance-hdr-qt-printer.patch | 28 ---------------------- 3 files changed, 6 insertions(+), 33 deletions(-) delete mode 100644 gnu/packages/patches/luminance-hdr-qt-printer.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index b5de70e120..f2a7b6b984 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1273,7 +1273,6 @@ dist_patch_DATA = \ %D%/packages/patches/lua-liblua-so.patch \ %D%/packages/patches/luajit-no_ldconfig.patch \ %D%/packages/patches/luit-posix.patch \ - %D%/packages/patches/luminance-hdr-qt-printer.patch \ %D%/packages/patches/lvm2-static-link.patch \ %D%/packages/patches/make-impure-dirs.patch \ %D%/packages/patches/mariadb-client-test-32bit.patch \ diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm index 610a3d77bf..f93b353dd6 100644 --- a/gnu/packages/image-viewers.scm +++ b/gnu/packages/image-viewers.scm @@ -329,7 +329,7 @@ It supports JPEG, PNG and GIF formats.") (define-public luminance-hdr (package (name "luminance-hdr") - (version "2.4.0") + (version "2.6.0") (source (origin (method url-fetch) (uri (string-append @@ -337,8 +337,7 @@ It supports JPEG, PNG and GIF formats.") version "/luminance-hdr-" version ".tar.bz2")) (sha256 (base32 - "00fldbcizrx8jcnjgq74n3zmbm27dxzl96fxa7q49689mfnlw08l")) - (patches (search-patches "luminance-hdr-qt-printer.patch")))) + "188q0l63nfasqfvwbq4mwx2vh7wsfi2bq9n5nksddspl1qz01lnp")))) (build-system cmake-build-system) (native-inputs `(("pkg-config" ,pkg-config) @@ -346,8 +345,10 @@ It supports JPEG, PNG and GIF formats.") (inputs `(("qtbase" ,qtbase) ("qtdeclarative" ,qtdeclarative) + ("qtsvg" ,qtsvg) ("qtwebkit" ,qtwebkit) ("boost" ,boost) + ("eigen" ,eigen) ;; ("gtest" ,gtest) ("libraw" ,libraw) ("zlib" ,zlib) @@ -360,7 +361,8 @@ It supports JPEG, PNG and GIF formats.") ("gsl" ,gsl) ("libtiff" ,libtiff))) (arguments - '(#:phases + '(#:tests? #f ;XXX: some tests fail to compile + #:phases (modify-phases %standard-phases (add-after 'set-paths 'add-ilmbase-include-path (lambda* (#:key inputs #:allow-other-keys) diff --git a/gnu/packages/patches/luminance-hdr-qt-printer.patch b/gnu/packages/patches/luminance-hdr-qt-printer.patch deleted file mode 100644 index c65f9537cd..0000000000 --- a/gnu/packages/patches/luminance-hdr-qt-printer.patch +++ /dev/null @@ -1,28 +0,0 @@ -Allow the 'QtPrinter' header to be found, as described -at . - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fbad8a2..8379c8a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,6 +29,7 @@ find_package(Qt5Xml) - find_package(Qt5Sql) - find_package(Qt5Network) - find_package(Qt5LinguistTools) -+find_package(Qt5PrintSupport REQUIRED) - IF(WIN32) - find_package(Qt5WinExtras) - ENDIF() -diff --git a/src/HelpBrowser/CMakeLists.txt b/src/HelpBrowser/CMakeLists.txt -index 04319a8..5537dae 100644 ---- a/src/HelpBrowser/CMakeLists.txt -+++ b/src/HelpBrowser/CMakeLists.txt -@@ -29,7 +29,7 @@ QT5_WRAP_UI(FILES_UI_H ${FILES_UI}) - - - ADD_LIBRARY(helpbrowser ${FILES_H} ${FILES_CPP} ${FILES_MOC} ${FILES_UI_H} ${FILES_HXX}) --qt5_use_modules(helpbrowser Core Concurrent Gui Widgets Xml WebKit WebKitWidgets) -+qt5_use_modules(helpbrowser Core Concurrent Gui Widgets Xml WebKit WebKitWidgets PrintSupport) - - SET(FILES_TO_TRANSLATE ${FILES_TO_TRANSLATE} ${FILES_CPP} ${FILES_H} ${FILES_UI} ${FILES_HXX} PARENT_SCOPE) - SET(LUMINANCE_MODULES_GUI ${LUMINANCE_MODULES_GUI} helpbrowser PARENT_SCOPE) -- cgit v1.2.3