From 4c153a9125fa0913077b06b5ed537958ae4ca163 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 25 Mar 2015 08:20:49 -0400 Subject: [PATCH 01/47] gnu: icecat: Apply fixes for CVE-2015-{0817,0818} and other selected bugs. * gnu/packages/patches/icecat-CVE-2015-0817.patch, gnu/packages/patches/icecat-CVE-2015-0818-pt1.patch, gnu/packages/patches/icecat-CVE-2015-0818-pt2.patch, gnu/packages/patches/icecat-bug-1127780.patch, gnu/packages/patches/icecat-bug-1144991.patch, gnu/packages/patches/icecat-bug-1145870.patch, gnu/packages/patches/icecat-bug-1146339.patch: New files. * gnu-system.am (dist_patch_DATA): Add them. * gnu/packages/gnuzilla.scm (icecat): Add patches. --- gnu-system.am | 7 + gnu/packages/gnuzilla.scm | 9 +- .../patches/icecat-CVE-2015-0817.patch | 44 +++++ .../patches/icecat-CVE-2015-0818-pt1.patch | 67 ++++++++ .../patches/icecat-CVE-2015-0818-pt2.patch | 28 +++ gnu/packages/patches/icecat-bug-1127780.patch | 25 +++ gnu/packages/patches/icecat-bug-1144991.patch | 76 ++++++++ gnu/packages/patches/icecat-bug-1145870.patch | 43 +++++ gnu/packages/patches/icecat-bug-1146339.patch | 162 ++++++++++++++++++ 9 files changed, 460 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/icecat-CVE-2015-0817.patch create mode 100644 gnu/packages/patches/icecat-CVE-2015-0818-pt1.patch create mode 100644 gnu/packages/patches/icecat-CVE-2015-0818-pt2.patch create mode 100644 gnu/packages/patches/icecat-bug-1127780.patch create mode 100644 gnu/packages/patches/icecat-bug-1144991.patch create mode 100644 gnu/packages/patches/icecat-bug-1145870.patch create mode 100644 gnu/packages/patches/icecat-bug-1146339.patch diff --git a/gnu-system.am b/gnu-system.am index 153d395b57..1f2ebdf29e 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -432,6 +432,13 @@ dist_patch_DATA = \ gnu/packages/patches/guix-test-networking.patch \ gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \ gnu/packages/patches/hop-bigloo-4.0b.patch \ + gnu/packages/patches/icecat-bug-1127780.patch \ + gnu/packages/patches/icecat-bug-1144991.patch \ + gnu/packages/patches/icecat-bug-1145870.patch \ + gnu/packages/patches/icecat-bug-1146339.patch \ + gnu/packages/patches/icecat-CVE-2015-0817.patch \ + gnu/packages/patches/icecat-CVE-2015-0818-pt1.patch \ + gnu/packages/patches/icecat-CVE-2015-0818-pt2.patch \ gnu/packages/patches/irrlicht-mesa-10.patch \ gnu/packages/patches/jbig2dec-ignore-testtest.patch \ gnu/packages/patches/kmod-module-directory.patch \ diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 1d450cda64..1e9deb8bff 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -224,7 +224,14 @@ standards.") version "/" name "-" version ".tar.bz2")) (sha256 (base32 - "1rr4axghaypdkrf60i1qp6dz4cd29ya02fs3vyffvp4x9kgcq2dd")))) + "1rr4axghaypdkrf60i1qp6dz4cd29ya02fs3vyffvp4x9kgcq2dd")) + (patches (map search-patch '("icecat-bug-1127780.patch" + "icecat-CVE-2015-0817.patch" + "icecat-bug-1144991.patch" + "icecat-CVE-2015-0818-pt1.patch" + "icecat-bug-1145870.patch" + "icecat-CVE-2015-0818-pt2.patch" + "icecat-bug-1146339.patch"))))) (build-system gnu-build-system) (inputs `(("alsa-lib" ,alsa-lib) diff --git a/gnu/packages/patches/icecat-CVE-2015-0817.patch b/gnu/packages/patches/icecat-CVE-2015-0817.patch new file mode 100644 index 0000000000..bb530a535d --- /dev/null +++ b/gnu/packages/patches/icecat-CVE-2015-0817.patch @@ -0,0 +1,44 @@ +From cedbdf8290018fbef65458e9e438c72adf2c2775 Mon Sep 17 00:00:00 2001 +From: Steve Fink +Date: Thu, 19 Mar 2015 15:46:24 -0700 +Subject: [PATCH] Bug 1145255. r=luke, a=lmandel + +--- + js/src/jit/AsmJS.cpp | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/js/src/jit/AsmJS.cpp b/js/src/jit/AsmJS.cpp +index 302b5ab..1b8eed6 100644 +--- a/js/src/jit/AsmJS.cpp ++++ b/js/src/jit/AsmJS.cpp +@@ -14,6 +14,7 @@ + + #include "jsmath.h" + #include "jsprf.h" ++#include "jsutil.h" + #include "jsworkers.h" + #include "prmjtime.h" + +@@ -3432,9 +3433,17 @@ FoldMaskedArrayIndex(FunctionCompiler &f, ParseNode **indexExpr, int32_t *mask, + if (IsLiteralOrConstInt(f, maskNode, &mask2)) { + // Flag the access to skip the bounds check if the mask ensures that an 'out of + // bounds' access can not occur based on the current heap length constraint. +- if (mask2 == 0 || +- CountLeadingZeroes32(f.m().minHeapLength() - 1) <= CountLeadingZeroes32(mask2)) { ++ if (mask2 == 0) { + *needsBoundsCheck = NO_BOUNDS_CHECK; ++ } else { ++ uint32_t minHeap = f.m().minHeapLength(); ++ uint32_t minHeapZeroes = CountLeadingZeroes32(minHeap - 1); ++ uint32_t maskZeroes = CountLeadingZeroes32(mask2); ++ if ((minHeapZeroes < maskZeroes) || ++ (IsPowerOfTwo(minHeap) && minHeapZeroes == maskZeroes)) ++ { ++ *needsBoundsCheck = NO_BOUNDS_CHECK; ++ } + } + *mask &= mask2; + *indexExpr = indexNode; +-- +2.2.1 + diff --git a/gnu/packages/patches/icecat-CVE-2015-0818-pt1.patch b/gnu/packages/patches/icecat-CVE-2015-0818-pt1.patch new file mode 100644 index 0000000000..5d396eed6b --- /dev/null +++ b/gnu/packages/patches/icecat-CVE-2015-0818-pt1.patch @@ -0,0 +1,67 @@ +From 79dddb16aaa58f5b5cef49dac6d234f500af3baf Mon Sep 17 00:00:00 2001 +From: Olli Pettay +Date: Thu, 19 Mar 2015 21:53:32 -0400 +Subject: [PATCH] Bug 1144988 - Don't let other pages to load while doing + scroll-to-anchor. r=bz, a=lmandel + +--- + docshell/base/nsDocShell.cpp | 23 ++++++++++++++--------- + docshell/base/nsDocShell.h | 1 + + 2 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp +index 887c910..14ff3f2 100644 +--- a/docshell/base/nsDocShell.cpp ++++ b/docshell/base/nsDocShell.cpp +@@ -4204,8 +4204,8 @@ nsDocShell::IsPrintingOrPP(bool aDisplayErrorDialog) + bool + nsDocShell::IsNavigationAllowed(bool aDisplayPrintErrorDialog) + { +- bool isAllowed = !IsPrintingOrPP(aDisplayPrintErrorDialog) && !mFiredUnloadEvent; +- if (!isAllowed) { ++ bool isAllowed = !IsPrintingOrPP(aDisplayPrintErrorDialog) && ++ !mFiredUnloadEvent && !mBlockNavigation; if (!isAllowed) { + return false; + } + if (!mContentViewer) { +@@ -9321,13 +9321,18 @@ nsDocShell::InternalLoad(nsIURI * aURI, + GetCurScrollPos(ScrollOrientation_X, &cx); + GetCurScrollPos(ScrollOrientation_Y, &cy); + +- // ScrollToAnchor doesn't necessarily cause us to scroll the window; +- // the function decides whether a scroll is appropriate based on the +- // arguments it receives. But even if we don't end up scrolling, +- // ScrollToAnchor performs other important tasks, such as informing +- // the presShell that we have a new hash. See bug 680257. +- rv = ScrollToAnchor(curHash, newHash, aLoadType); +- NS_ENSURE_SUCCESS(rv, rv); ++ { ++ AutoRestore scrollingToAnchor(mBlockNavigation); ++ mBlockNavigation = true; ++ ++ // ScrollToAnchor doesn't necessarily cause us to scroll the window; ++ // the function decides whether a scroll is appropriate based on the ++ // arguments it receives. But even if we don't end up scrolling, ++ // ScrollToAnchor performs other important tasks, such as informing ++ // the presShell that we have a new hash. See bug 680257. ++ rv = ScrollToAnchor(curHash, newHash, aLoadType); ++ NS_ENSURE_SUCCESS(rv, rv); ++ } + + // Reset mLoadType to its original value once we exit this block, + // because this short-circuited load might have started after a +diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h +index c191777..be353ee 100644 +--- a/docshell/base/nsDocShell.h ++++ b/docshell/base/nsDocShell.h +@@ -835,6 +835,7 @@ protected: + bool mInPrivateBrowsing; + bool mUseRemoteTabs; + bool mDeviceSizeIsPageSize; ++ bool mBlockNavigation; + + // Because scriptability depends on the mAllowJavascript values of our + // ancestors, we cache the effective scriptability and recompute it when +-- +2.2.1 + diff --git a/gnu/packages/patches/icecat-CVE-2015-0818-pt2.patch b/gnu/packages/patches/icecat-CVE-2015-0818-pt2.patch new file mode 100644 index 0000000000..4eac5df4db --- /dev/null +++ b/gnu/packages/patches/icecat-CVE-2015-0818-pt2.patch @@ -0,0 +1,28 @@ +From 83364c747c421b191f9d4012896a9e5a1d5223ad Mon Sep 17 00:00:00 2001 +From: Kyle Huey +Date: Fri, 20 Mar 2015 19:15:13 -0700 +Subject: [PATCH] Bug 1144988. r=bz a=lmandel + +--- + docshell/base/nsDocShell.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp +index 4cddcef..bdf88a5cf 100644 +--- a/docshell/base/nsDocShell.cpp ++++ b/docshell/base/nsDocShell.cpp +@@ -1322,9 +1322,10 @@ nsDocShell::LoadURI(nsIURI * aURI, + + // Note: we allow loads to get through here even if mFiredUnloadEvent is + // true; that case will get handled in LoadInternal or LoadHistoryEntry. +- if (IsPrintingOrPP()) { ++ if (IsPrintingOrPP() || mBlockNavigation) { + return NS_OK; // JS may not handle returning of an error code + } ++ + nsCOMPtr referrer; + nsCOMPtr postStream; + nsCOMPtr headersStream; +-- +2.2.1 + diff --git a/gnu/packages/patches/icecat-bug-1127780.patch b/gnu/packages/patches/icecat-bug-1127780.patch new file mode 100644 index 0000000000..c433616087 --- /dev/null +++ b/gnu/packages/patches/icecat-bug-1127780.patch @@ -0,0 +1,25 @@ +From cf1de3d04302841aaa05aed8364da3399cbca9b4 Mon Sep 17 00:00:00 2001 +From: Bobby Holley +Date: Tue, 17 Feb 2015 17:47:12 -0500 +Subject: [PATCH] Bug 1127780 - Add null check. r=bz, a=bkerensa + +--- + js/xpconnect/wrappers/XrayWrapper.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h +index ead095f1..cc8c580 100644 +--- a/js/xpconnect/wrappers/XrayWrapper.h ++++ b/js/xpconnect/wrappers/XrayWrapper.h +@@ -131,7 +131,7 @@ class XrayWrapper : public Base { + { + if (!Base::getPrototypeOf(cx, wrapper, protop)) + return false; +- if (WrapperFactory::IsXrayWrapper(protop)) ++ if (!protop || WrapperFactory::IsXrayWrapper(protop)) + return true; + + protop.set(JS_GetObjectPrototype(cx, wrapper)); +-- +2.2.1 + diff --git a/gnu/packages/patches/icecat-bug-1144991.patch b/gnu/packages/patches/icecat-bug-1144991.patch new file mode 100644 index 0000000000..5632e37eb3 --- /dev/null +++ b/gnu/packages/patches/icecat-bug-1144991.patch @@ -0,0 +1,76 @@ +From ae49ed04f54c2f78d6ba7e545e0099602a3270fa Mon Sep 17 00:00:00 2001 +From: Boris Zbarsky +Date: Thu, 19 Mar 2015 18:58:44 -0400 +Subject: [PATCH] Bug 1144991 - Be a bit more restrictive about when a + URI_IS_UI_RESOURCE source is allowed to link to a URI_IS_UI_RESOURCE URI that + doesn't have the same scheme. r=bholley, a=abillings + +--- + caps/src/nsScriptSecurityManager.cpp | 38 +++++++++++++++++++++++++----------- + 1 file changed, 27 insertions(+), 11 deletions(-) + +diff --git a/caps/src/nsScriptSecurityManager.cpp b/caps/src/nsScriptSecurityManager.cpp +index 3587358..6577b95 100644 +--- a/caps/src/nsScriptSecurityManager.cpp ++++ b/caps/src/nsScriptSecurityManager.cpp +@@ -770,12 +770,31 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, + NS_ENSURE_SUCCESS(rv, rv); + if (hasFlags) { + if (aFlags & nsIScriptSecurityManager::ALLOW_CHROME) { ++ ++ // For now, don't change behavior for resource:// or moz-icon:// and ++ // just allow them. + if (!targetScheme.EqualsLiteral("chrome")) { +- // for now don't change behavior for resource: or moz-icon: + return NS_OK; + } + +- // allow load only if chrome package is whitelisted ++ // Allow a URI_IS_UI_RESOURCE source to link to a URI_IS_UI_RESOURCE ++ // target if ALLOW_CHROME is set. ++ // ++ // ALLOW_CHROME is a flag that we pass on all loads _except_ docshell ++ // loads (since docshell loads run the loaded content with its origin ++ // principal). So we're effectively allowing resource://, chrome://, ++ // and moz-icon:// source URIs to load resource://, chrome://, and ++ // moz-icon:// files, so long as they're not loading it as a document. ++ bool sourceIsUIResource; ++ rv = NS_URIChainHasFlags(sourceBaseURI, ++ nsIProtocolHandler::URI_IS_UI_RESOURCE, ++ &sourceIsUIResource); ++ NS_ENSURE_SUCCESS(rv, rv); ++ if (sourceIsUIResource) { ++ return NS_OK; ++ } ++ ++ // Allow the load only if the chrome package is whitelisted. + nsCOMPtr reg(do_GetService( + NS_CHROMEREGISTRY_CONTRACTID)); + if (reg) { +@@ -787,17 +806,14 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal, + } + } + +- // resource: and chrome: are equivalent, securitywise +- // That's bogus!! Fix this. But watch out for +- // the view-source stylesheet? +- bool sourceIsChrome; +- rv = NS_URIChainHasFlags(sourceBaseURI, +- nsIProtocolHandler::URI_IS_UI_RESOURCE, +- &sourceIsChrome); +- NS_ENSURE_SUCCESS(rv, rv); +- if (sourceIsChrome) { ++ // Special-case the hidden window: it's allowed to load ++ // URI_IS_UI_RESOURCE no matter what. Bug 1145470 tracks removing this. ++ nsAutoCString sourceSpec; ++ if (NS_SUCCEEDED(sourceBaseURI->GetSpec(sourceSpec)) && ++ sourceSpec.EqualsLiteral("resource://gre-resources/hiddenWindow.html")) { + return NS_OK; + } ++ + if (reportErrors) { + ReportError(nullptr, errorTag, sourceURI, aTargetURI); + } +-- +2.2.1 + diff --git a/gnu/packages/patches/icecat-bug-1145870.patch b/gnu/packages/patches/icecat-bug-1145870.patch new file mode 100644 index 0000000000..34a018c697 --- /dev/null +++ b/gnu/packages/patches/icecat-bug-1145870.patch @@ -0,0 +1,43 @@ +From a40e2ebc2ab57dacb539d4e49ed4193764ff7112 Mon Sep 17 00:00:00 2001 +From: Kyle Huey +Date: Fri, 20 Mar 2015 19:05:56 -0700 +Subject: [PATCH] Bug 1145870. r=bz a=lmandel + +--- + docshell/base/nsDocShell.cpp | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp +index 14ff3f2..4cddcef 100644 +--- a/docshell/base/nsDocShell.cpp ++++ b/docshell/base/nsDocShell.cpp +@@ -8900,6 +8900,8 @@ nsDocShell::InternalLoad(nsIURI * aURI, + + NS_ENSURE_TRUE(!mIsBeingDestroyed, NS_ERROR_NOT_AVAILABLE); + ++ NS_ENSURE_TRUE(!mBlockNavigation, NS_ERROR_UNEXPECTED); ++ + // wyciwyg urls can only be loaded through history. Any normal load of + // wyciwyg through docshell is illegal. Disallow such loads. + if (aLoadType & LOAD_CMD_NORMAL) { +@@ -12570,7 +12572,7 @@ nsDocShell::OnLinkClick(nsIContent* aContent, + { + NS_ASSERTION(NS_IsMainThread(), "wrong thread"); + +- if (!IsOKToLoadURI(aURI)) { ++ if (!IsOKToLoadURI(aURI) || mBlockNavigation) { + return NS_OK; + } + +@@ -12626,7 +12628,7 @@ nsDocShell::OnLinkClickSync(nsIContent *aContent, + *aRequest = nullptr; + } + +- if (!IsOKToLoadURI(aURI)) { ++ if (!IsOKToLoadURI(aURI) || mBlockNavigation) { + return NS_OK; + } + +-- +2.2.1 + diff --git a/gnu/packages/patches/icecat-bug-1146339.patch b/gnu/packages/patches/icecat-bug-1146339.patch new file mode 100644 index 0000000000..9d858523b9 --- /dev/null +++ b/gnu/packages/patches/icecat-bug-1146339.patch @@ -0,0 +1,162 @@ +From 4ca86283a71427f27e810d77c8e75418f6428457 Mon Sep 17 00:00:00 2001 +From: Olli Pettay +Date: Mon, 23 Mar 2015 22:23:53 -0400 +Subject: [PATCH] Bug 1146339 - Do anchor scrolling right before dispatching + popstate/hashchange. r=bz, a=lmandel + +--- + docshell/base/nsDocShell.cpp | 64 +++++++++++++++++++++----------------------- + docshell/base/nsDocShell.h | 1 - + 2 files changed, 30 insertions(+), 35 deletions(-) + +diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp +index bdf88a5cf..efb6a6e 100644 +--- a/docshell/base/nsDocShell.cpp ++++ b/docshell/base/nsDocShell.cpp +@@ -1322,7 +1322,7 @@ nsDocShell::LoadURI(nsIURI * aURI, + + // Note: we allow loads to get through here even if mFiredUnloadEvent is + // true; that case will get handled in LoadInternal or LoadHistoryEntry. +- if (IsPrintingOrPP() || mBlockNavigation) { ++ if (IsPrintingOrPP()) { + return NS_OK; // JS may not handle returning of an error code + } + +@@ -4206,7 +4206,8 @@ bool + nsDocShell::IsNavigationAllowed(bool aDisplayPrintErrorDialog) + { + bool isAllowed = !IsPrintingOrPP(aDisplayPrintErrorDialog) && +- !mFiredUnloadEvent && !mBlockNavigation; if (!isAllowed) { ++ !mFiredUnloadEvent; ++ if (!isAllowed) { + return false; + } + if (!mContentViewer) { +@@ -8901,8 +8902,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, + + NS_ENSURE_TRUE(!mIsBeingDestroyed, NS_ERROR_NOT_AVAILABLE); + +- NS_ENSURE_TRUE(!mBlockNavigation, NS_ERROR_UNEXPECTED); +- + // wyciwyg urls can only be loaded through history. Any normal load of + // wyciwyg through docshell is illegal. Disallow such loads. + if (aLoadType & LOAD_CMD_NORMAL) { +@@ -9324,19 +9323,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, + GetCurScrollPos(ScrollOrientation_X, &cx); + GetCurScrollPos(ScrollOrientation_Y, &cy); + +- { +- AutoRestore scrollingToAnchor(mBlockNavigation); +- mBlockNavigation = true; +- +- // ScrollToAnchor doesn't necessarily cause us to scroll the window; +- // the function decides whether a scroll is appropriate based on the +- // arguments it receives. But even if we don't end up scrolling, +- // ScrollToAnchor performs other important tasks, such as informing +- // the presShell that we have a new hash. See bug 680257. +- rv = ScrollToAnchor(curHash, newHash, aLoadType); +- NS_ENSURE_SUCCESS(rv, rv); +- } +- + // Reset mLoadType to its original value once we exit this block, + // because this short-circuited load might have started after a + // normal, network load, and we don't want to clobber its load type. +@@ -9424,16 +9410,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, + mOSHE->SetCacheKey(cacheKey); + } + +- /* restore previous position of scroller(s), if we're moving +- * back in history (bug 59774) +- */ +- if (mOSHE && (aLoadType == LOAD_HISTORY || aLoadType == LOAD_RELOAD_NORMAL)) +- { +- nscoord bx, by; +- mOSHE->GetScrollPosition(&bx, &by); +- SetCurScrollPosEx(bx, by); +- } +- + /* Restore the original LSHE if we were loading something + * while short-circuited load was initiated. + */ +@@ -9471,12 +9447,36 @@ nsDocShell::InternalLoad(nsIURI * aURI, + + SetDocCurrentStateObj(mOSHE); + ++ // Inform the favicon service that the favicon for oldURI also ++ // applies to aURI. ++ CopyFavicon(currentURI, aURI, mInPrivateBrowsing); ++ ++ nsRefPtr win = mScriptGlobal ? ++ mScriptGlobal->GetCurrentInnerWindowInternal() : nullptr; ++ ++ // ScrollToAnchor doesn't necessarily cause us to scroll the window; ++ // the function decides whether a scroll is appropriate based on the ++ // arguments it receives. But even if we don't end up scrolling, ++ // ScrollToAnchor performs other important tasks, such as informing ++ // the presShell that we have a new hash. See bug 680257. ++ rv = ScrollToAnchor(curHash, newHash, aLoadType); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ /* restore previous position of scroller(s), if we're moving ++ * back in history (bug 59774) ++ */ ++ if (mOSHE && (aLoadType == LOAD_HISTORY || ++ aLoadType == LOAD_RELOAD_NORMAL)) { ++ nscoord bx, by; ++ mOSHE->GetScrollPosition(&bx, &by); ++ SetCurScrollPosEx(bx, by); ++ } ++ + // Dispatch the popstate and hashchange events, as appropriate. + // + // The event dispatch below can cause us to re-enter script and + // destroy the docshell, nulling out mScriptGlobal. Hold a stack + // reference to avoid null derefs. See bug 914521. +- nsRefPtr win = mScriptGlobal; + if (win) { + // Fire a hashchange event URIs differ, and only in their hashes. + bool doHashchange = sameExceptHashes && !curHash.Equals(newHash); +@@ -9492,10 +9492,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, + } + } + +- // Inform the favicon service that the favicon for oldURI also +- // applies to aURI. +- CopyFavicon(currentURI, aURI, mInPrivateBrowsing); +- + return NS_OK; + } + } +@@ -12573,7 +12569,7 @@ nsDocShell::OnLinkClick(nsIContent* aContent, + { + NS_ASSERTION(NS_IsMainThread(), "wrong thread"); + +- if (!IsOKToLoadURI(aURI) || mBlockNavigation) { ++ if (!IsOKToLoadURI(aURI)) { + return NS_OK; + } + +@@ -12629,7 +12625,7 @@ nsDocShell::OnLinkClickSync(nsIContent *aContent, + *aRequest = nullptr; + } + +- if (!IsOKToLoadURI(aURI) || mBlockNavigation) { ++ if (!IsOKToLoadURI(aURI)) { + return NS_OK; + } + +diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h +index be353ee..c191777 100644 +--- a/docshell/base/nsDocShell.h ++++ b/docshell/base/nsDocShell.h +@@ -835,7 +835,6 @@ protected: + bool mInPrivateBrowsing; + bool mUseRemoteTabs; + bool mDeviceSizeIsPageSize; +- bool mBlockNavigation; + + // Because scriptability depends on the mAllowJavascript values of our + // ancestors, we cache the effective scriptability and recompute it when +-- +2.2.1 + From a31a6d22d64b2627437e0e25529cf37caf79f4dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Tue, 24 Mar 2015 19:52:22 +0800 Subject: [PATCH 02/47] gnu: Add gnome-mines. * gnu/packages/gnome.scm (gnome-mines): New variable. --- gnu/packages/gnome.scm | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 3b70e27816..0e674da899 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -1621,3 +1621,48 @@ library.") ;; This is the license of the rsvg bindings. The license of each module ;; of gnome-python-desktop is given in 'COPYING'. (license license:lgpl2.1+))) + +(define-public gnome-mines + (package + (name "gnome-mines") + (version "3.14.1") + (source + (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/" name "/" + (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 + "0nbgvzlsznn3v83pdcx2d52r4ig1mvaijh633rjddx9rgq2ja7kv")))) + (build-system glib-or-gtk-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-before configure patch-/bin/true + (lambda _ + (substitute* "configure" + (("/bin/true") (which "true"))))) + (add-after install wrap-pixbuf + ;; Use librsvg's loaders.cache to support SVG files. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (prog (string-append out "/bin/gnome-mines")) + (rsvg (assoc-ref inputs "librsvg")) + (pixbuf (find-files rsvg "^loaders\\.cache$"))) + (wrap-program prog + `("GDK_PIXBUF_MODULE_FILE" = ,pixbuf)))))))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("desktop-file-utils" ,desktop-file-utils) + ("intltool" ,intltool) + ("itstool" ,itstool))) + (inputs + `(("gtk+" ,gtk+) + ("librsvg" ,librsvg))) + (home-page "https://wiki.gnome.org/Apps/Mines") + (synopsis "Minesweeper game") + (description + "Mines (previously gnomine) is a puzzle game where you locate mines +floating in an ocean using only your brain and a little bit of luck.") + (license license:gpl2+))) From e4160d0585862ab7e4c0b941d69781be2466e056 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 25 Mar 2015 23:09:22 -0400 Subject: [PATCH 03/47] gnu: openssh: Update to 6.8p1. * gnu/packages/ssh.scm (openssh): Update to 6.8p1. Make 'patch-tests' substitution more robust. --- gnu/packages/ssh.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/packages/ssh.scm b/gnu/packages/ssh.scm index 10697850f4..29251291dc 100644 --- a/gnu/packages/ssh.scm +++ b/gnu/packages/ssh.scm @@ -122,7 +122,7 @@ a server that supports the SSH-2 protocol.") (define-public openssh (package (name "openssh") - (version "6.7p1") + (version "6.8p1") (source (origin (method url-fetch) (uri (let ((tail (string-append name "-" version ".tar.gz"))) @@ -131,7 +131,7 @@ a server that supports the SSH-2 protocol.") (string-append "ftp://ftp2.fr.openbsd.org/pub/OpenBSD/OpenSSH/portable/" tail)))) (sha256 (base32 - "01smf9pvn2sk5qs80gkmc9acj07ckawi1b3xxyysp3c5mr73ky5j")))) + "03hnrqvjq6ghg1mp3gkarfxh6g3x1n1vjrzpbc5lh9717vklrxiz")))) (build-system gnu-build-system) (inputs `(("groff" ,groff) ("openssl" ,openssl) @@ -149,9 +149,10 @@ a server that supports the SSH-2 protocol.") (alist-cons-before 'check 'patch-tests (lambda _ - ;; remove tests that require the user sshd + ;; remove 't-exec' regress target which requires user 'sshd' (substitute* "regress/Makefile" - (("t10 t-exec") "t10"))) + (("^(REGRESS_TARGETS=.*) t-exec(.*)" all pre post) + (string-append pre post)))) (alist-replace 'install (lambda* (#:key (make-flags '()) #:allow-other-keys) From af5b817ea9f4320b4cbffc85b3f57223a5b9463c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 25 Mar 2015 19:20:11 +0100 Subject: [PATCH 04/47] gnu: openblas: build for all supported CPUs. * gnu/packages/maths.scm (openblas)[arguments]: Add "DYNAMIC_ARCH=1" to make flags. Remove "#:substitutable? #f". --- gnu/packages/maths.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 49667cc71b..417af4a91b 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -1033,11 +1033,14 @@ constant parts of it.") (build-system gnu-build-system) (arguments '(#:tests? #f ;no "check" target - #:substitutable? #f ;force local build because of CPU detection #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) "SHELL=bash" - "NO_LAPACK=1") + "NO_LAPACK=1" + ;; Build the library for all supported CPUs. This allows + ;; switching CPU targets at runtime with the environment variable + ;; OPENBLAS_CORETYPE=, where "type" is a supported CPU type. + "DYNAMIC_ARCH=1") ;; no configure script #:phases (alist-delete 'configure %standard-phases))) (inputs From aad6f5bcda28bd598f4937df8f97e651b4a97e8f Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 16 Mar 2015 07:54:13 +0100 Subject: [PATCH 05/47] gnu: Add IBus. * gnu/packages/ibus.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. --- gnu-system.am | 1 + gnu/packages/ibus.scm | 92 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 gnu/packages/ibus.scm diff --git a/gnu-system.am b/gnu-system.am index 1f2ebdf29e..d20a5967ef 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -146,6 +146,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/haskell.scm \ gnu/packages/hugs.scm \ gnu/packages/hurd.scm \ + gnu/packages/ibus.scm \ gnu/packages/icu4c.scm \ gnu/packages/idutils.scm \ gnu/packages/image.scm \ diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm new file mode 100644 index 0000000000..813d0040ee --- /dev/null +++ b/gnu/packages/ibus.scm @@ -0,0 +1,92 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Ricardo Wurmus +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages ibus) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system glib-or-gtk) + #:use-module (gnu packages) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages iso-codes) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python)) + +(define-public ibus + (package + (name "ibus") + (version "1.5.5") + (source (origin + (method url-fetch) + (uri (string-append "https://ibus.googlecode.com/files/ibus-" + version ".tar.gz")) + (sha256 + (base32 + "1v4a9xv2k26g6ggk4282ynfvh68j2r5hg1cdpvnryfa8c2pkdaq2")))) + (build-system glib-or-gtk-build-system) + (arguments + `(#:tests? #f ; tests fail because there's no connection to dbus + #:make-flags + (list "CC=gcc" + (string-append "pyoverridesdir=" + (assoc-ref %outputs "out") + "/lib/python2.7/site-packages/gi/overrides/")) + #:phases + (alist-cons-before + 'configure 'disable-dconf-update + (lambda _ + (substitute* "data/dconf/Makefile.in" + (("dconf update") "echo dconf update")) + #t) + (alist-cons-after + 'wrap-program 'wrap-with-additional-paths + (lambda* (#:key outputs #:allow-other-keys) + ;; Make sure 'ibus-setup' runs with the correct PYTHONPATH and + ;; GI_TYPELIB_PATH. + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/bin/ibus-setup") + `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH"))) + `("GI_TYPELIB_PATH" ":" prefix + (,(getenv "GI_TYPELIB_PATH") + ,(string-append out "/lib/girepository-1.0")))))) + %standard-phases)))) + (inputs + `(("dbus" ,dbus) + ("dconf" ,dconf) + ("gconf" ,gconf) + ("glib" ,glib) + ("gtk2" ,gtk+-2) + ("intltool" ,intltool) + ("libnotify" ,libnotify) + ("iso-codes" ,iso-codes) + ("pygobject2" ,python2-pygobject) + ("python2" ,python-2))) + (native-inputs + `(("glib" ,glib "bin") ; for glib-genmarshal + ("gobject-introspection" ,gobject-introspection) ; for g-ir-compiler + ("pkg-config" ,pkg-config))) + (synopsis "Input method framework") + (description + "IBus is an input framework providing a full-featured and user-friendly +input method user interface. It comes with multilingual input support. It +may also simplify input method development.") + (home-page "http://ibus.googlecode.com/") + (license lgpl2.1+))) From e7682771686e2aa90bf4c244a6995db21d0070ae Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sun, 22 Mar 2015 16:23:47 +0300 Subject: [PATCH 06/47] gnu: Add LIRC. * gnu/packages/lirc.scm: New file. * gnu/packages/patches/lirc-localstatedir.patch: New file. * gnu-system.am: Add them. --- gnu-system.am | 2 + gnu/packages/lirc.scm | 61 +++++++++++++++++++ gnu/packages/patches/lirc-localstatedir.patch | 13 ++++ 3 files changed, 76 insertions(+) create mode 100644 gnu/packages/lirc.scm create mode 100644 gnu/packages/patches/lirc-localstatedir.patch diff --git a/gnu-system.am b/gnu-system.am index d20a5967ef..2e36dae0df 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -181,6 +181,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/lightning.scm \ gnu/packages/links.scm \ gnu/packages/linux.scm \ + gnu/packages/lirc.scm \ gnu/packages/lisp.scm \ gnu/packages/llvm.scm \ gnu/packages/lout.scm \ @@ -459,6 +460,7 @@ dist_patch_DATA = \ gnu/packages/patches/libvpx-fix-armhf-link.patch \ gnu/packages/patches/libvpx-fix-ssse3-quantize.patch \ gnu/packages/patches/libvpx-vp9-out-of-bounds-access.patch \ + gnu/packages/patches/lirc-localstatedir.patch \ gnu/packages/patches/lm-sensors-hwmon-attrs.patch \ gnu/packages/patches/lua51-liblua-so.patch \ gnu/packages/patches/luajit-no_ldconfig.patch \ diff --git a/gnu/packages/lirc.scm b/gnu/packages/lirc.scm new file mode 100644 index 0000000000..c070e1aaa4 --- /dev/null +++ b/gnu/packages/lirc.scm @@ -0,0 +1,61 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Alex Kost +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages lirc) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages linux) + #:use-module (gnu packages xorg) + #:use-module (gnu packages python)) + +(define-public lirc + (package + (name "lirc") + (version "0.9.2a") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/lirc/lirc-" + version ".tar.bz2")) + (sha256 + (base32 + "011nwpxm5d12rsapljg3pjf9pgb0j8ngmc3zg69q4kv61hkx2zim")) + (patches (list (search-patch "lirc-localstatedir.patch"))))) + (build-system gnu-build-system) + (arguments + '(#:configure-flags '("--localstatedir=/var"))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libx11" ,libx11) + ("alsa-lib" ,alsa-lib) + ("python" ,python))) + (home-page "http://www.lirc.org/") + (synopsis "Linux Infrared Remote Control") + (description + "LIRC allows computers to send and receive IR signals of many commonly +used remote controls. The most important part of LIRC is the 'lircd' daemon +that decodes IR signals received by the device drivers. The second daemon +program 'lircmd' allows to translate IR signals to mouse movements. The +user space applications allow you to control your computer with a remote +control: you can send X events to applications, start programs and much more +on just one button press.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/lirc-localstatedir.patch b/gnu/packages/patches/lirc-localstatedir.patch new file mode 100644 index 0000000000..43a41a743f --- /dev/null +++ b/gnu/packages/patches/lirc-localstatedir.patch @@ -0,0 +1,13 @@ +Do not try to create $localstatedir as we cannot do this when it is /var. + +--- lirc-0.9.2a/daemons/Makefile.in ++++ lirc-0.9.2a/daemons/Makefile.in +@@ -790,9 +790,6 @@ + uninstall-local uninstall-sbinPROGRAMS + + +-install-exec-local: +- test -d $(DESTDIR)$(varrundir)/$(PACKAGE) \ +- || mkdir -p $(DESTDIR)$(varrundir)/$(PACKAGE) + uninstall-local: + -$(RM) $(DESTDIR)$(varrundir)/$(PACKAGE)/lircd From aa4ed92314166a099d3a51681f6d155b384dd4ed Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Sun, 22 Mar 2015 16:33:17 +0300 Subject: [PATCH 07/47] services: Add 'lirc-service'. * gnu/services/lirc.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Various Services): New node. Document 'lirc-service'. --- doc/guix.texi | 21 +++++++++++++ gnu-system.am | 1 + gnu/services/lirc.scm | 68 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 gnu/services/lirc.scm diff --git a/doc/guix.texi b/doc/guix.texi index 17365036e8..3c72e6596e 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -154,6 +154,7 @@ Services * Base Services:: Essential system services. * Networking Services:: Network setup, SSH daemon, etc. * X Window:: Graphical display. +* Various Services:: Other services. Packaging Guidelines @@ -4350,6 +4351,7 @@ declaration. * Base Services:: Essential system services. * Networking Services:: Network setup, SSH daemon, etc. * X Window:: Graphical display. +* Various Services:: Other services. @end menu @node Base Services @@ -4686,6 +4688,25 @@ appropriate screen resolution; otherwise, it must be a list of resolutions---e.g., @code{((1024 768) (640 480))}. @end deffn +@node Various Services +@subsubsection Various Services + +The @code{(gnu services lirc)} module provides the following service. + +@deffn {Monadic Procedure} lirc-service [#:lirc lirc] @ + [#:device #f] [#:driver #f] [#:config-file #f] @ + [#:extra-options '()] +Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that +decodes infrared signals from remote controls. + +Optionally, @var{device}, @var{driver} and @var{config-file} +(configuration file name) may be specified. See @command{lircd} manual +for details. + +Finally, @var{extra-options} is a list of additional command-line options +passed to @command{lircd}. +@end deffn + @node Setuid Programs @subsection Setuid Programs diff --git a/gnu-system.am b/gnu-system.am index 2e36dae0df..6fdd60d9b7 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -325,6 +325,7 @@ GNU_SYSTEM_MODULES = \ gnu/services/base.scm \ gnu/services/dbus.scm \ gnu/services/dmd.scm \ + gnu/services/lirc.scm \ gnu/services/networking.scm \ gnu/services/ssh.scm \ gnu/services/xorg.scm \ diff --git a/gnu/services/lirc.scm b/gnu/services/lirc.scm new file mode 100644 index 0000000000..857f362db7 --- /dev/null +++ b/gnu/services/lirc.scm @@ -0,0 +1,68 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Alex Kost +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services lirc) + #:use-module (gnu services) + #:use-module (gnu packages lirc) + #:use-module (guix monads) + #:use-module (guix store) + #:use-module (guix gexp) + #:export (lirc-service)) + +;;; Commentary: +;;; +;;; LIRC services. +;;; +;;; Code: + +(define* (lirc-service #:key (lirc lirc) + device driver config-file + (extra-options '())) + "Return a service that runs @url{http://www.lirc.org,LIRC}, a daemon that +decodes infrared signals from remote controls. + +The daemon will use specified @var{device}, @var{driver} and +@var{config-file} (configuration file name). + +Finally, @var{extra-options} is a list of additional command-line options +passed to @command{lircd}." + (with-monad %store-monad + (return + (service + (provision '(lircd)) + (documentation "Run the LIRC daemon.") + (requirement '(user-processes)) + (start #~(make-forkexec-constructor + (list (string-append #$lirc "/sbin/lircd") + "--nodaemon" + #$@(if device + #~("--device" #$device) + #~()) + #$@(if driver + #~("--driver" #$driver) + #~()) + #$@(if config-file + #~(#$config-file) + #~()) + #$@extra-options))) + (stop #~(make-kill-destructor)) + (activate #~(begin + (use-modules (guix build utils)) + (mkdir-p "/var/run/lirc"))))))) + +;;; lirc.scm ends here From 52b76622e4a3ca8b830d1e1ccb911844ed92905b Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 25 Mar 2015 21:48:28 +0300 Subject: [PATCH 08/47] services: guix-service: Add service documentation. * gnu/services/base.scm (guix-service): Add 'documentation' field to the service. --- gnu/services/base.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index a9126032bb..24e6d32359 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -640,6 +640,7 @@ passed to @command{guix-daemon}." (with-monad %store-monad (return (service + (documentation "Run the Guix daemon.") (provision '(guix-daemon)) (requirement '(user-processes)) (start From 0afc0afede54c9d9a0c88ea6f3731f9ccaf5de93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 26 Mar 2015 16:37:47 +0100 Subject: [PATCH 09/47] gnu: nano: Update to 2.4.0. * gnu/packages/nano.scm (nano): Update to 2.4.0. --- gnu/packages/nano.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/nano.scm b/gnu/packages/nano.scm index 1bb6fea889..150e1e0641 100644 --- a/gnu/packages/nano.scm +++ b/gnu/packages/nano.scm @@ -27,7 +27,7 @@ (define-public nano (package (name "nano") - (version "2.3.6") + (version "2.4.0") (source (origin (method url-fetch) @@ -35,7 +35,7 @@ version ".tar.gz")) (sha256 (base32 - "0d4ml0v9yi37pjs211xs38w9whsj6530wz3kmrvwgh8jigqz6jx7")))) + "1gbm9bcv4k55y01r5q8a8a9s3yrrgq3z5jxxiij3wl404r8gnxjh")))) (build-system gnu-build-system) (inputs `(("gettext" ,gnu-gettext) From 9355498dd79d127f5107a82cfa840fe1a5cd46cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 26 Mar 2015 16:38:16 +0100 Subject: [PATCH 10/47] gnu: tor: Update to 0.2.5.11. * gnu/packages/tor.scm (tor): Update to 0.2.5.11. --- gnu/packages/tor.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm index 73becbba92..dcb6dab83e 100644 --- a/gnu/packages/tor.scm +++ b/gnu/packages/tor.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014, 2015 Mark H Weaver ;;; ;;; This file is part of GNU Guix. @@ -32,14 +32,14 @@ (define-public tor (package (name "tor") - (version "0.2.5.10") + (version "0.2.5.11") (source (origin (method url-fetch) (uri (string-append "https://www.torproject.org/dist/tor-" version ".tar.gz")) (sha256 (base32 - "0fx8qnwh2f8ykfx0np4hyznjfi4xfy96z59pk96y3zyjvjjh5pdk")))) + "0sb7ai8r9c0nvdagjrbfqpri6x4njfxv954fxrjv46rzkkpgmq5f")))) (build-system gnu-build-system) (inputs `(("zlib" ,zlib) From e1ac691dfa5e8b7e374a9b7ec18cb69f3a6622c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 26 Mar 2015 16:40:35 +0100 Subject: [PATCH 11/47] gnu: global: Update to 6.4. * gnu/packages/code.scm (global): Update to 6.4. --- gnu/packages/code.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index ad61b85afc..ed9ba0e31f 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -23,6 +23,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system gnu) #:use-module (gnu packages compression) + #:use-module (gnu packages databases) #:use-module (gnu packages emacs) #:use-module (gnu packages pcre) #:use-module (gnu packages pkg-config) @@ -86,21 +87,24 @@ highlighting your own code that seemed comprehensible when you wrote it.") (define-public global ; a global variable (package (name "global") - (version "6.3.4") + (version "6.4") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/global/global-" version ".tar.gz")) (sha256 (base32 - "0hcplcayyjf42d8ygzla6142b5dq4ybq4wg3n3cgx3b5yfhvic85")))) + "13i4zwx6gaibc4j79wd0hgxysw8ibxz9c018zxhydnxlyadzcnri")))) (build-system gnu-build-system) (inputs `(("ncurses" ,ncurses) - ("libltdl" ,libltdl))) + ("libltdl" ,libltdl) + ("sqlite" ,sqlite))) (arguments `(#:configure-flags (list (string-append "--with-ncurses=" - (assoc-ref %build-inputs "ncurses"))) + (assoc-ref %build-inputs "ncurses")) + (string-append "--with-sqlite3=" + (assoc-ref %build-inputs "sqlite"))) #:phases (alist-cons-after 'install 'post-install From 24066017a979aeb59b380d802af58d3fbfc3edd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cech?= Date: Thu, 26 Mar 2015 16:08:13 +0100 Subject: [PATCH 12/47] gnu: wpa-supplicant: Install DBUS access configuration. * gnu/packages/admin.scm (wpa-supplicant): Install DBUS configuration file. --- gnu/packages/admin.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 95b0c9f007..4d4cef7cf3 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -783,7 +783,15 @@ This package provides the 'wpa_supplicant' daemon and the 'wpa_cli' command.") CONFIG_CTRL_IFACE_DBUS_INTRO=y\n" port) (close-port port)) #t) - ,phases)))))) + (alist-cons-after + 'install-man-pages 'install-dbus-conf + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (dir (string-append out "/etc/dbus-1/system.d"))) + (mkdir-p dir) + (copy-file "dbus/dbus-wpa_supplicant.conf" + (string-append dir "/wpa_supplicant.conf")))) + ,phases))))))) (define-public wakelan (package From 122c87ead0452a3042f1d42db9986a41218732cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Thu, 26 Mar 2015 23:34:21 +0100 Subject: [PATCH 13/47] Fix remaining references to "substitute-binary". * nix/nix-daemon/guix-daemon.cc (main): Change substitute-binary to substitute. * po/guix/POTFILES.in: Likewise. * tests/guix-daemon.sh: Likewise. * tests/guix-system.sh: Likewise. --- nix/nix-daemon/guix-daemon.cc | 2 +- po/guix/POTFILES.in | 2 +- tests/guix-daemon.sh | 4 ++-- tests/guix-system.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index ca39c2f497..f096ed5a97 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -310,7 +310,7 @@ main (int argc, char *argv[]) if (subs == "default") { string subst = - settings.nixLibexecDir + "/guix/substitute-binary"; + settings.nixLibexecDir + "/guix/substitute"; setenv ("NIX_SUBSTITUTERS", subst.c_str (), 1); } } diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in index 619f6f99fc..39115f970b 100644 --- a/po/guix/POTFILES.in +++ b/po/guix/POTFILES.in @@ -9,7 +9,7 @@ guix/scripts/package.scm guix/scripts/gc.scm guix/scripts/hash.scm guix/scripts/pull.scm -guix/scripts/substitute-binary.scm +guix/scripts/substitute.scm guix/scripts/authenticate.scm guix/scripts/system.scm guix/scripts/lint.scm diff --git a/tests/guix-daemon.sh b/tests/guix-daemon.sh index a73c9e22e3..87f17def12 100644 --- a/tests/guix-daemon.sh +++ b/tests/guix-daemon.sh @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see . # -# Test the daemon and its interaction with 'guix substitute-binary'. +# Test the daemon and its interaction with 'guix substitute'. # set -e @@ -51,7 +51,7 @@ Deriver: $drv EOF # Remove the cached narinfo. -rm -f "$XDG_CACHE_HOME/guix/substitute-binary/$hash_part" +rm -f "$XDG_CACHE_HOME/guix/substitute/$hash_part" # Make sure we see the substitute. guile -c ' diff --git a/tests/guix-system.sh b/tests/guix-system.sh index 76e722fbc1..1b77d1a0db 100644 --- a/tests/guix-system.sh +++ b/tests/guix-system.sh @@ -17,7 +17,7 @@ # along with GNU Guix. If not, see . # -# Test the daemon and its interaction with 'guix substitute-binary'. +# Test the daemon and its interaction with 'guix substitute'. # set -e From ee3b55ea6d68ee998ac183ab1cb6f02f18fc8ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Fri, 20 Mar 2015 15:52:52 +0100 Subject: [PATCH 14/47] gnu: Add libva. * gnu/packages/video.scm (libva): New variable. --- gnu/packages/video.scm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index a7f39b8249..cca26f1840 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -69,6 +69,7 @@ #:use-module (gnu packages textutils) #:use-module (gnu packages version-control) #:use-module (gnu packages web) + #:use-module (gnu packages xdisorg) #:use-module (gnu packages xiph) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) @@ -195,6 +196,35 @@ developed according to the official standards for DV video: IEC 61834 and SMPTE 314M.") (license lgpl2.1+))) +(define-public libva + (package + (name "libva") + (version "1.5.1") + (source + (origin + (method url-fetch) + (uri (string-append + "http://www.freedesktop.org/software/vaapi/releases/libva/libva-" + version".tar.bz2")) + (sha256 + (base32 "01d01mm9fgpwzqycmjjcj3in3vvzcibi3f64icsw2sksmmgb4495")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("libdrm" ,libdrm) + ("libx11" ,libx11) + ("libxext" ,libxext) + ("libxfixes" ,libxfixes) + ("mesa" ,mesa))) + (home-page "http://www.freedesktop.org/wiki/Software/vaapi/") + (synopsis "Video acceleration library") + (description "The main motivation for VA-API (Video Acceleration API) is +to enable hardware accelerated video decode/encode at various +entry-points (VLD, IDCT, Motion Compensation etc.) for prevailing coding +standards (MPEG-2, MPEG-4 ASP/H.263, MPEG-4 AVC/H.264, and VC-1/VMW3).") + (license expat))) + (define-public ffmpeg (package (name "ffmpeg") From 9b5db9be7f109dbdeda56b42853550f7b749b385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sat, 21 Mar 2015 19:36:25 +0100 Subject: [PATCH 15/47] gnu: freeglut: Add mesa to propagated inputs. * gnu/packages/gl.scm (freeglut): Add mesa to propagated inputs. --- gnu/packages/gl.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gl.scm b/gnu/packages/gl.scm index e9b2c535a8..dc90a1231d 100644 --- a/gnu/packages/gl.scm +++ b/gnu/packages/gl.scm @@ -84,7 +84,10 @@ as ASCII text.") ("libxxf86vm" ,libxxf86vm) ("inputproto" ,inputproto) ("xinput" ,xinput))) - (propagated-inputs `(("glu" ,glu))) + (propagated-inputs + ;; Headers from Mesa and GLU are needed. + `(("glu" ,glu) + ("mesa" ,mesa))) (home-page "http://freeglut.sourceforge.net/") (synopsis "Alternative to the OpenGL Utility Toolkit (GLUT)") (description From 060ad3def45745e26c4ce75883eb1d3ae22d6839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sat, 21 Mar 2015 19:40:21 +0100 Subject: [PATCH 16/47] gnu: Add libwebp. * gnu/packages/image.scm (libwebp): New variable. --- gnu/packages/image.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 11cb63a895..9c7e50494f 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -29,6 +29,7 @@ #:use-module (gnu packages doxygen) #:use-module (gnu packages fontutils) #:use-module (gnu packages ghostscript) + #:use-module (gnu packages gl) #:use-module (gnu packages maths) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -475,3 +476,39 @@ algorithms and data structures. It is particularly strong for multi-dimensional image processing.") (license license:expat) (home-page "https://hci.iwr.uni-heidelberg.de/vigra"))) + +(define-public libwebp + (package + (name "libwebp") + (version "0.4.3") + (source + (origin + (method url-fetch) + (uri (string-append + "http://downloads.webmproject.org/releases/webp/libwebp-" version + ".tar.gz")) + (sha256 + (base32 "1i4hfczjm3b1qj1g4cc9hgb69l47f3nkgf6hk7nz4dm9zmc0vgpg")))) + (build-system gnu-build-system) + (inputs + `(("freeglut" ,freeglut) + ("giflib" ,giflib) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff))) + (arguments + '(#:configure-flags '("--enable-libwebpmux" + "--enable-libwebpdemux" + "--enable-libwebpdecoder"))) + (home-page "https://developers.google.com/speed/webp/") + (synopsis "Lossless and lossy image compression") + (description + "WebP is a new image format that provides lossless and lossy compression +for images. WebP lossless images are 26% smaller in size compared to +PNGs. WebP lossy images are 25-34% smaller in size compared to JPEG images at +equivalent SSIM index. WebP supports lossless transparency (also known as +alpha channel) with just 22% additional bytes. Transparency is also supported +with lossy compression and typically provides 3x smaller file sizes compared +to PNG when lossy compression is acceptable for the red/green/blue color +channels.") + (license license:bsd-3))) From 894e2cba52acd91e56066fb584c782d75dc32f3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sat, 21 Mar 2015 19:41:54 +0100 Subject: [PATCH 17/47] gnu: Add leptonica. * gnu/packages/image.scm (leptonica): New variable. --- gnu/packages/image.scm | 60 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index 9c7e50494f..93dd2ac4e6 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -24,6 +24,7 @@ (define-module (gnu packages image) #:use-module (gnu packages) #:use-module (gnu packages algebra) + #:use-module (gnu packages autotools) #:use-module (gnu packages boost) #:use-module (gnu packages compression) #:use-module (gnu packages doxygen) @@ -164,6 +165,65 @@ the W3C's XML-based Scaleable Vector Graphic (SVG) format.") ;; 'COPYING' is the GPLv2, but file headers say LGPLv2.0+. (license license:lgpl2.0+))) +(define-public leptonica + (package + (name "leptonica") + (version "1.71") + (source + (origin + (method url-fetch) + (uri (string-append "http://www.leptonica.com/source/leptonica-" + version ".tar.gz")) + (sha256 + (base32 "0j5qgrff6im5n9waflbi7w643q1p6mahyf2z35gb4vj9h5p76pfc")) + (modules '((guix build utils))) + ;; zlib and openjpg should be under Libs, not Libs.private. See: + ;; https://code.google.com/p/tesseract-ocr/issues/detail?id=1436 + (snippet + '(substitute* "lept.pc.in" + (("^(Libs\\.private: .*)@ZLIB_LIBS@(.*)" all pre post) + (string-append pre post)) + (("^(Libs\\.private: .*)@JPEG_LIBS@(.*)" all pre post) + (string-append pre post)) + (("^Libs: .*" all) + (string-append all " @ZLIB_LIBS@ @JPEG_LIBS@")))))) + (build-system gnu-build-system) + (native-inputs + `(("gnuplot" ,gnuplot))) ;needed for test suite + (inputs + `(("giflib" ,giflib) + ("libjpeg" ,libjpeg) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("libwebp" ,libwebp))) + (propagated-inputs + `(("openjpeg" ,openjpeg) + ("zlib" ,zlib))) + (arguments + '(#:phases + (modify-phases %standard-phases + ;; Prevent make from trying to regenerate config.h.in. + (add-after + unpack set-config-h-in-file-time + (lambda _ + (set-file-time "config/config.h.in" (stat "configure")))) + (add-after + unpack patch-reg-wrapper + (lambda _ + (substitute* "prog/reg_wrapper.sh" + ((" /bin/sh ") + (string-append " " (which "sh") " ")))))))) + (home-page "http://www.leptonica.com/") + (synopsis "Library and tools for image processing and analysis") + (description + "Leptonica is a C library and set of command-line tools for efficient +image processing and image analysis operations. It supports rasterop, affine +transformations, binary and grayscale morphology, rank order, and convolution, +seedfill and connected components, image transformations combining changes in +scale and pixel depth, and pixelwise masking, blending, enhancement, and +arithmetic ops.") + (license license:bsd-2))) + (define-public jbig2dec (package (name "jbig2dec") From 9e617a5419bbb2e4dabe95d07f9bf94c9d041c22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Fri, 20 Mar 2015 16:22:34 +0100 Subject: [PATCH 18/47] gnu: Rename (gnu packages ocrad) to (gnu packages ocr). * gnu/packages/ocrad.scm: Deleted. * gnu/packages/ocr.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Change ocrad.scm to ocr.scm. --- gnu-system.am | 2 +- gnu/packages/{ocrad.scm => ocr.scm} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename gnu/packages/{ocrad.scm => ocr.scm} (98%) diff --git a/gnu-system.am b/gnu-system.am index 6fdd60d9b7..46807b67c7 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -221,7 +221,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/nutrition.scm \ gnu/packages/nvi.scm \ gnu/packages/ocaml.scm \ - gnu/packages/ocrad.scm \ + gnu/packages/ocr.scm \ gnu/packages/onc-rpc.scm \ gnu/packages/openbox.scm \ gnu/packages/openldap.scm \ diff --git a/gnu/packages/ocrad.scm b/gnu/packages/ocr.scm similarity index 98% rename from gnu/packages/ocrad.scm rename to gnu/packages/ocr.scm index 8ad4f32670..8408b43367 100644 --- a/gnu/packages/ocrad.scm +++ b/gnu/packages/ocr.scm @@ -16,7 +16,7 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . -(define-module (gnu packages ocrad) +(define-module (gnu packages ocr) #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) From d814be32d5205fc946ba4dce724b6202718df268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sat, 21 Mar 2015 20:11:56 +0100 Subject: [PATCH 19/47] gnu: Add tesseract-ocr. * gnu/packages/ocr.scm (tesseract-ocr): New variable. --- gnu/packages/ocr.scm | 55 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/gnu/packages/ocr.scm b/gnu/packages/ocr.scm index 8408b43367..32da42b95f 100644 --- a/gnu/packages/ocr.scm +++ b/gnu/packages/ocr.scm @@ -17,12 +17,14 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages ocr) - #:use-module (guix licenses) + #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module ((gnu packages compression) - #:select (lzip))) + #:use-module (gnu packages autotools) + #:use-module (gnu packages compression) + #:use-module (gnu packages image) + #:use-module (gnu packages pkg-config)) (define-public ocrad (package @@ -43,4 +45,49 @@ "GNU Ocrad is an optical character recognition program based on a feature extraction method. It can read images in PBM, PGM or PPM formats and it produces text in 8-bit or UTF-8 formats.") - (license gpl3+))) + (license license:gpl3+))) + +(define-public tesseract-ocr + (package + (name "tesseract-ocr") + (version "3.02.02") + (source + (origin + (method url-fetch) + (uri (string-append + "https://tesseract-ocr.googlecode.com/files/tesseract-ocr-" + version ".tar.gz")) + (sha256 + (base32 "0g81m9y4iydp7kgr56mlkvjdwpp3mb01q385yhdnyvra7z5kkk96")) + (modules '((guix build utils))) + ;; Leptonica added a pkg-config file in the meanwhile. + (snippet + '(substitute* "tesseract.pc.in" + (("^# Requires: lept ## .*") + "Requires: lept\n"))))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + (propagated-inputs + `(("leptonica" ,leptonica))) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after + unpack autogen + (lambda _ + (zero? (system* "sh" "autogen.sh"))))) + #:configure-flags + (let ((leptonica (assoc-ref %build-inputs "leptonica"))) + (list (string-append "LIBLEPT_HEADERSDIR=" leptonica "/include"))))) + (home-page "https://code.google.com/p/tesseract-ocr/") + (synopsis "Optical character recognition engine") + (description + "Tesseract is an optical character recognition (OCR) engine with very +high accuracy. It supports many languages, output text formatting, hOCR +positional information and page layout analysis. Several image formats are +supported through the Leptonica library. It can also detect whether text is +monospaced or proportional.") + (license license:asl2.0))) From 6f6c8b653792599f2e866887b29c86dd51638d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Sat, 21 Mar 2015 23:09:11 +0100 Subject: [PATCH 20/47] gnu: Add vapoursynth. * gnu/packages/video.scm (vapoursynth): New variable. --- gnu/packages/video.scm | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index cca26f1840..c202c6f140 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -56,6 +56,7 @@ #:use-module (gnu packages lua) #:use-module (gnu packages mp3) #:use-module (gnu packages ncurses) + #:use-module (gnu packages ocr) #:use-module (gnu packages openssl) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -1095,6 +1096,47 @@ capabilities.") (alist-delete 'install %standard-phases))))))))) +(define-public vapoursynth + (package + (name "vapoursynth") + (version "26") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/vapoursynth/vapoursynth/archive/R" + version ".tar.gz")) + (sha256 + (base32 + "1qbg5kg0kgrxldd0ckn1s7vy7vx2ig8nqzv6djp38fxccpzw3x9k")))) + (build-system gnu-build-system) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("cython" ,python-cython) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) + ("python" ,python) + ("yasm" ,yasm))) + (inputs + `(("ffmpeg" ,ffmpeg) + ("libass" ,libass) + ("tesseract-ocr" ,tesseract-ocr))) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-after + unpack autogen + (lambda _ + (zero? (system* "sh" "autogen.sh"))))))) + (home-page "http://www.vapoursynth.com/") + (synopsis "Video processing framework") + (description "VapourSynth is a C++ library and Python module for video +manipulation. It aims to be a modern rewrite of Avisynth, supporting +multithreading, generalized colorspaces, per frame properties, and videos with +format changes.") + ;; As seen from the source files. + (license lgpl2.1+))) + (define-public xvid (package (name "xvid") From 1c1178cd17d037638255ae5ecd52a6c48d8a2e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Thu, 19 Mar 2015 23:46:21 +0100 Subject: [PATCH 21/47] gnu: Add mpv. * gnu/packages/video.scm (mpv): New variable. --- gnu/packages/video.scm | 86 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index c202c6f140..4c3c3ec44b 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -30,6 +30,7 @@ #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module (guix build-system python) + #:use-module (guix build-system waf) #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages audio) @@ -667,6 +668,91 @@ several areas.") ;; is under lgpl3+, thus the whole project becomes gpl3+. (license gpl3+))) +(define-public mpv + (package + (name "mpv") + (version "0.8.3") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/mpv-player/mpv/archive/v" version + ".tar.gz")) + (sha256 + (base32 + "1kw9hr957cxqgm2i94bgqc6sskm6bwhm0akzckilhs460b43h409")) + (file-name (string-append name "-" version ".tar.gz")))) + (build-system waf-build-system) + (native-inputs + `(("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python-docutils" ,python-docutils))) + ;; Missing features: libguess, LIRC, Wayland, VDPAU, V4L2 + (inputs + `(("alsa-lib" ,alsa-lib) + ("enca" ,enca) + ("ffmpeg" ,ffmpeg) + ("jack" ,jack-2) + ("ladspa" ,ladspa) + ("lcms" ,lcms) + ("libass" ,libass) + ("libbluray" ,libbluray) + ("libcaca" ,libcaca) + ("libbs2b" ,libbs2b) + ("libcdio-paranoia" ,libcdio-paranoia) + ("libdvdread" ,libdvdread) + ("libdvdnav" ,libdvdnav) + ("libjpeg" ,libjpeg) + ("libva" ,libva) + ("libx11" ,libx11) + ("libxext" ,libxext) + ("libxinerama" ,libxinerama) + ("libxrandr" ,libxrandr) + ("libxscrnsaver" ,libxscrnsaver) + ("libxv" ,libxv) + ("lua" ,lua) + ("mesa" ,mesa) + ("mpg123" ,mpg123) + ("pulseaudio" ,pulseaudio) + ("rsound" ,rsound) + ("samba" ,samba) + ("vapoursynth" ,vapoursynth) + ("waf" ,(origin + (method url-fetch) + ;; Keep this in sync with the version in the bootstrap.py + ;; script of the source tarball. + (uri "http://www.freehackers.org/~tnagy/release/waf-1.8.4") + (sha256 + (base32 + "1a7skwgpl91adhcwlmdr76xzdpidh91hvcmj34zz6548bpx3a87h")))) + ("youtube-dl" ,youtube-dl) + ("zlib" ,zlib))) + (arguments + '(#:phases + (modify-phases %standard-phases + (add-before + configure setup-waf + (lambda* (#:key inputs #:allow-other-keys) + (copy-file (assoc-ref inputs "waf") "waf") + (setenv "CC" "gcc"))) + (add-before + configure patch-wscript + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "wscript" + ;; XXX Remove this when our Samba package provides a .pc file. + (("check_pkg_config\\('smbclient'\\)") + "check_cc(lib='smbclient')") + ;; XXX Remove this when our Lua package provides a .pc file. + (("check_lua") + "check_cc(lib='lua')"))))) + ;; No check function defined. + #:tests? #f)) + (home-page "http://mpv.io/") + (synopsis "Audio and video player") + (description "mpv is a general-purpose audio and video player. It is a +fork of mplayer2 and MPlayer. It shares some features with the former +projects while introducing many more.") + (license gpl2+))) + (define-public libvpx (package (name "libvpx") From 2babe98e4e24ed91bbda9ad2e89731c1f345a75e Mon Sep 17 00:00:00 2001 From: Jason Self Date: Sat, 28 Mar 2015 19:26:02 -0700 Subject: [PATCH 22/47] gnu: linux-libre: Update to 3.18.10 * gnu/packages/linux.scm (linux-libre): Update to version 3.18.10. --- gnu/packages/linux.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index bd9ae0e08d..c48fefa7c2 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -198,7 +198,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM." #f))) (define-public linux-libre - (let* ((version "3.18.9") + (let* ((version "3.18.10") (build-phase '(lambda* (#:key system inputs #:allow-other-keys #:rest args) ;; Apply the neat patch. @@ -271,7 +271,7 @@ for SYSTEM, or #f if there is no configuration for SYSTEM." (uri (linux-libre-urls version)) (sha256 (base32 - "0n3p9ci8w71hd168df7xlccafxzb3agr8rk3xmvnj7dnbfiddqv6")))) + "0ckbi94b56klp59wsfcmlkbyrj7hj7kb7ys2jjsrqsk39dd77zg5")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl) ("bc" ,bc) From 3bfc99c74cfc0cf6613f7c39c1f39bbe08b586d0 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 27 Mar 2015 16:12:01 -0500 Subject: [PATCH 23/47] gnu: Add Catch. * gnu/packages/check.scm (catch-framework): New variable. --- gnu/packages/check.scm | 45 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index afaf5571e5..3e686cc743 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012 Nikita Karetnikov ;;; Copyright © 2015 Paul van der Walt +;;; Copyright © 2015 Eric Bavier ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,7 +24,9 @@ #:use-module (guix licenses) #:use-module (guix packages) #:use-module (guix download) - #:use-module (guix build-system gnu)) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial)) (define-public check (package @@ -99,3 +102,43 @@ with a flexible variety of user interfaces.") unit testing. Test output is in XML for automatic testing and GUI based for supervised tests.") (license lgpl2.1))) ; no copyright notices. LGPL2.1 is in the tarball + +(define-public catch-framework + (package + (name "catch") + (version "1.0.53") ;Sub-minor is the build number + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/philsquared/Catch") + ;; Semi-arbitrary. Contains mostly documentation fixes + ;; since build 53. + (commit "b9ec8a1"))) + (file-name (string-append name "-" version)) + (sha256 + (base32 + "05iijiwjwcjbza7qamwd32d0jypi0lpywmilmmj2xh280mcl4dbd")))) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder (begin + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (output (assoc-ref %outputs "out")) + (incdir (string-append output "/include")) + (docdir (string-append output "/share/doc/catch-" + ,version))) + (begin + (for-each mkdir-p (list incdir docdir)) + (copy-file (string-append source + "/single_include/catch.hpp") + (string-append incdir + "/catch.hpp")) + (copy-recursively (string-append source "/docs") + docdir)))))) + (home-page "http://catch-lib.net/") + (synopsis "Automated test framework for C++ and Objective-C") + (description + "Catch stands for C++ Automated Test Cases in Headers and is a +multi-paradigm automated test framework for C++ and Objective-C.") + (license boost1.0))) From b4a9c92467c49d21601b1736f72648c6425c7150 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 27 Mar 2015 16:15:02 -0500 Subject: [PATCH 24/47] gnu: Add UnQLite. * gnu/packages/databases.scm (unqlite): New variable. --- gnu/packages/databases.scm | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index 29b7dbba55..ee97977777 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -38,7 +38,7 @@ #:use-module (gnu packages python) #:use-module ((guix licenses) #:select (gpl2 gpl3+ lgpl2.1+ lgpl3+ x11-style non-copyleft - public-domain)) + bsd-2 public-domain)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) @@ -538,3 +538,29 @@ Driver.") (license lgpl2.1+) ;; COPYING contains copy of lgpl2.1 - but copyright notices just say "LGPL" (home-page "http://www.unixodbc.org"))) + +(define-public unqlite + (package + (name "unqlite") + (version "1.1.6") + (source (origin + (method url-fetch) + ;; Contains bug fixes against the official release, and has an + ;; autotooled build system. + (uri (string-append "https://github.com/aidin36/tocc/releases/" + "download/v1.0.0/" + "unqlite-unofficial-" version ".tar.gz")) + (sha256 + (base32 + "1sbpvhg15gadq0mpcy16q7k3rkg4b4dicpnn5xifpkpn02sqik3s")))) + (build-system gnu-build-system) + (arguments `(#:tests? #f)) ;No check target + (home-page "http://www.unqlite.org") + (synopsis "In-memory key/value and document store") + (description + "UnQLite is an in-process software library which implements a +self-contained, serverless, zero-configuration, transactional NoSQL +database engine. UnQLite is a document store database similar to +MongoDB, Redis, CouchDB, etc. as well as a standard Key/Value store +similar to BerkelyDB, LevelDB, etc.") + (license bsd-2))) From 065b79549737a23731b30249c1e5889d6618231a Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 27 Mar 2015 16:16:41 -0500 Subject: [PATCH 25/47] gnu: Add tocc. * gnu/packages/search.scm (libtocc, tocc): New variables. --- gnu/packages/search.scm | 69 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/gnu/packages/search.scm b/gnu/packages/search.scm index f56a85e005..d1133248df 100644 --- a/gnu/packages/search.scm +++ b/gnu/packages/search.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2015 Eric Bavier ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,11 +19,13 @@ (define-module (gnu packages search) #:use-module ((guix licenses) - #:select (gpl2+ bsd-3 x11)) + #:select (gpl2+ gpl3+ bsd-3 x11)) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) #:use-module (gnu packages compression) + #:use-module (gnu packages check) + #:use-module (gnu packages databases) #:use-module (gnu packages linux) #:export (xapian)) @@ -55,4 +58,68 @@ rich set of boolean query operators.") (home-page "http://xapian.org/") (license (list gpl2+ bsd-3 x11)))) +(define-public libtocc + (package + (name "libtocc") + (version "1.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://github.com/aidin36/tocc/releases/download/" + "v" version "/tocc-" version ".tar.gz")) + (sha256 + (base32 + "1kd2jd74m8ksc8s7hh0haz0q0c3n0mr39bbky262kk4l58f1g068")))) + (build-system gnu-build-system) + (native-inputs `(("catch" ,catch-framework))) + (inputs `(("unqlite" ,unqlite))) + (arguments + `(#:phases (modify-phases %standard-phases + (add-before + configure chdir-source + (lambda _ (chdir "libtocc/src"))) + (replace + check + (lambda _ + (with-directory-excursion "../tests" + (and (zero? (system* "./configure" + (string-append "CONFIG_SHELL=" + (which "sh")) + (string-append "SHELL=" + (which "sh")) + "CPPFLAGS=-I../src" + "LDFLAGS=-L../src/.libs")) + (zero? (system* "make")) + (zero? (system* "./libtocctests"))))))))) + (home-page "http://t-o-c-c.com/") + (synopsis "Tool for Obsessive Compulsive Classifiers") + (description + "libtocc is the engine of the Tocc project, a tag-based file management +system. The goal of Tocc is to provide a better system for classifying files +that is more flexible than classic file systems that are based on a tree of +files and directories.") + (license gpl3+))) + +(define-public tocc + (package + (name "tocc") + (version (package-version libtocc)) + (source (package-source libtocc)) + (build-system gnu-build-system) + (inputs + `(("libtocc" ,libtocc) + ("unqlite" ,unqlite))) + (arguments + `(#:tests? #f ;No tests + #:phases (modify-phases %standard-phases + (add-after + unpack chdir-source + (lambda _ (chdir "cli/src")))))) + (home-page "http://t-o-c-c.com/") + (synopsis "Command-line interface to libtocc") + (description + "Tocc is a tag-based file management system. This package contains the +command line tool for interacting with libtocc.") + (license gpl3+))) + ;;; search.scm ends here From b39fc6f7bcbe2c87247be48393a5a4105e08cc6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 28 Mar 2015 21:16:36 +0100 Subject: [PATCH 26/47] doc: Update gexp wrt. extensibility. This is a followup to bcb1328. * doc/guix.texi (G-Expressions): Move paragraph about extensibility below. Remove assumptions that things are either packages or derivations. --- doc/guix.texi | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 3c72e6596e..18e6733083 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2490,13 +2490,9 @@ Gexps are meant to be written to a file and run or manipulated by other processes. @item -When a package or derivation is unquoted inside a gexp, the result is as -if its output file name had been introduced. - -Actually this mechanism is not limited to package and derivation -objects; @dfn{compilers} able to ``lower'' other high-level objects to -derivations can be defined, such that these objects can also be inserted -into gexps. +When a high-level object such as a package or derivation is unquoted +inside a gexp, the result is as if its output file name had been +introduced. @item Gexps carry information about the packages or derivations they refer to, @@ -2504,6 +2500,11 @@ and these dependencies are automatically added as inputs to the build processes that use them. @end itemize +Actually this mechanism is not limited to package and derivation +objects; @dfn{compilers} able to ``lower'' other high-level objects to +derivations can be defined, such that these objects can also be inserted +into gexps. + To illustrate the idea, here is an example of a gexp: @example @@ -2563,24 +2564,24 @@ or more of the following forms: @table @code @item #$@var{obj} @itemx (ungexp @var{obj}) -Introduce a reference to @var{obj}. @var{obj} may be a package or a +Introduce a reference to @var{obj}. @var{obj} may have one of the +supported types, for example a package or a derivation, in which case the @code{ungexp} form is replaced by its output file name---e.g., @code{"/gnu/store/@dots{}-coreutils-8.22}. -If @var{obj} is a list, it is traversed and any package or derivation -references are substituted similarly. +If @var{obj} is a list, it is traversed and references to supported +objects are substituted similarly. If @var{obj} is another gexp, its contents are inserted and its dependencies are added to those of the containing gexp. If @var{obj} is another kind of object, it is inserted as is. -@item #$@var{package-or-derivation}:@var{output} -@itemx (ungexp @var{package-or-derivation} @var{output}) +@item #$@var{obj}:@var{output} +@itemx (ungexp @var{obj} @var{output}) This is like the form above, but referring explicitly to the -@var{output} of @var{package-or-derivation}---this is useful when -@var{package-or-derivation} produces multiple outputs (@pxref{Packages -with Multiple Outputs}). +@var{output} of @var{obj}---this is useful when @var{obj} produces +multiple outputs (@pxref{Packages with Multiple Outputs}). @item #+@var{obj} @itemx #+@var{obj}:output From d9ae938f2c950f3bf1896fb07189c3e28b4d8029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 28 Mar 2015 21:26:33 +0100 Subject: [PATCH 27/47] gexp: Add 'local-file'. * guix/gexp.scm (): New record type. (local-file): New procedure. (local-file-compiler): New compiler. (gexp->sexp) : Handle the case where 'lower' returns a file name. (text-file*): Update docstring.local-file doc * tests/gexp.scm ("one local file", "gexp->derivation, local-file"): New tests. * doc/guix.texi (G-Expressions): Mention local files early. Document 'local-file'. Update 'text-file*' documentation. --- doc/guix.texi | 24 +++++++++++++++++++++--- guix/gexp.scm | 47 +++++++++++++++++++++++++++++++++++++++++++---- tests/gexp.scm | 26 ++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 7 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 18e6733083..4e549ac2ef 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -2503,7 +2503,10 @@ processes that use them. Actually this mechanism is not limited to package and derivation objects; @dfn{compilers} able to ``lower'' other high-level objects to derivations can be defined, such that these objects can also be inserted -into gexps. +into gexps. Another useful type of high-level object that can be +inserted in a gexp is @dfn{local files}, which allows files from the +local file system to be added to the store and referred to by +derivations and such (see @code{local-file} below.) To illustrate the idea, here is an example of a gexp: @@ -2666,6 +2669,20 @@ refer to. Any reference to another store item will lead to a build error. The other arguments are as for @code{derivation} (@pxref{Derivations}). @end deffn +@deffn {Scheme Procedure} local-file @var{file} [@var{name}] @ + [#:recursive? #t] +Return an object representing local file @var{file} to add to the store; this +object can be used in a gexp. @var{file} will be added to the store under @var{name}--by +default the base name of @var{file}. + +When @var{recursive?} is true, the contents of @var{file} are added recursively; if @var{file} +designates a flat file and @var{recursive?} is true, its contents are added, and its +permission bits are kept. + +This is the declarative counterpart of the @code{interned-file} monadic +procedure (@pxref{The Store Monad, @code{interned-file}}). +@end deffn + @deffn {Monadic Procedure} gexp->script @var{name} @var{exp} Return an executable script @var{name} that runs @var{exp} using @var{guile} with @var{modules} in its search path. @@ -2703,8 +2720,9 @@ or a subset thereof. @deffn {Monadic Procedure} text-file* @var{name} @var{text} @dots{} Return as a monadic value a derivation that builds a text file containing all of @var{text}. @var{text} may list, in addition to -strings, packages, derivations, and store file names; the resulting -store file holds references to all these. +strings, objects of any type that can be used in a gexp: packages, +derivations, local file objects, etc. The resulting store file holds +references to all these. This variant should be preferred over @code{text-file} anytime the file to create will reference items from the store. This is typically the diff --git a/guix/gexp.scm b/guix/gexp.scm index 01290dba18..2492974d8f 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -31,6 +31,8 @@ gexp-input gexp-input? + local-file + local-file? gexp->derivation gexp->file @@ -133,6 +135,37 @@ cross-compiling.)" (with-monad %store-monad (return drv))) + +;;; +;;; Local files. +;;; + +(define-record-type + (%local-file file name recursive?) + local-file? + (file local-file-file) ;string + (name local-file-name) ;string + (recursive? local-file-recursive?)) ;Boolean + +(define* (local-file file #:optional (name (basename file)) + #:key (recursive? #t)) + "Return an object representing local file FILE to add to the store; this +object can be used in a gexp. FILE will be added to the store under NAME--by +default the base name of FILE. + +When RECURSIVE? is true, the contents of FILE are added recursively; if FILE +designates a flat file and RECURSIVE? is true, its contents are added, and its +permission bits are kept. + +This is the declarative counterpart of the 'interned-file' monadic procedure." + (%local-file file name recursive?)) + +(define-gexp-compiler (local-file-compiler (file local-file?) system target) + ;; "Compile" FILE by adding it to the store. + (match file + (($ file name recursive?) + (interned-file file name #:recursive? recursive?)))) + ;;; ;;; Inputs & outputs. @@ -453,8 +486,13 @@ and in the current monad setting (system type, etc.)" (($ (? struct? thing) output n?) (let ((lower (lookup-compiler thing)) (target (if (or n? native?) #f target))) - (mlet %store-monad ((drv (lower thing system target))) - (return (derivation->output-path drv output))))) + (mlet %store-monad ((obj (lower thing system target))) + ;; OBJ must be either a derivation or a store file name. + (return (match obj + ((? derivation? drv) + (derivation->output-path drv output)) + ((? string? file) + file)))))) (($ x) (return x)) (x @@ -809,8 +847,9 @@ its search path." (define* (text-file* name #:rest text) "Return as a monadic value a derivation that builds a text file containing -all of TEXT. TEXT may list, in addition to strings, packages, derivations, -and store file names; the resulting store file holds references to all these." +all of TEXT. TEXT may list, in addition to strings, objects of any type that +can be used in a gexp: packages, derivations, local file objects, etc. The +resulting store file holds references to all these." (define builder (gexp (call-with-output-file (ungexp output "out") (lambda (port) diff --git a/tests/gexp.scm b/tests/gexp.scm index 0540969503..f81ef39860 100644 --- a/tests/gexp.scm +++ b/tests/gexp.scm @@ -97,6 +97,18 @@ %store (package-source coreutils)))) (gexp->sexp* exp))))) +(test-assert "one local file" + (let* ((file (search-path %load-path "guix.scm")) + (local (local-file file)) + (exp (gexp (display (ungexp local)))) + (intd (add-to-store %store (basename file) #t + "sha256" file))) + (and (gexp? exp) + (match (gexp-inputs exp) + (((x "out")) + (eq? x local))) + (equal? `(display ,intd) (gexp->sexp* exp))))) + (test-assert "same input twice" (let ((exp (gexp (begin (display (ungexp coreutils)) @@ -336,6 +348,20 @@ (mlet %store-monad ((drv mdrv)) (return (string=? system (derivation-system drv)))))) +(test-assertm "gexp->derivation, local-file" + (mlet* %store-monad ((file -> (search-path %load-path "guix.scm")) + (intd (interned-file file)) + (local -> (local-file file)) + (exp -> (gexp (begin + (stat (ungexp local)) + (symlink (ungexp local) + (ungexp output))))) + (drv (gexp->derivation "local-file" exp))) + (mbegin %store-monad + (built-derivations (list drv)) + (return (string=? (readlink (derivation->output-path drv)) + intd))))) + (test-assertm "gexp->derivation, cross-compilation" (mlet* %store-monad ((target -> "mips64el-linux") (exp -> (gexp (list (ungexp coreutils) From 2242ff45fa25656a0b4420fc901e22058513e338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 28 Mar 2015 18:24:03 +0100 Subject: [PATCH 28/47] gexp: Slightly simplify 'lower-inputs'. * guix/gexp.scm (lower-inputs): Simplify first case by removing the 'input' binding. --- guix/gexp.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/guix/gexp.scm b/guix/gexp.scm index 2492974d8f..de8b7bbb46 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -204,12 +204,12 @@ the cross-compilation target triplet." (with-monad %store-monad (sequence %store-monad (map (match-lambda - ((and ((? struct? thing) sub-drv ...) input) - (mlet* %store-monad ((lower -> (lookup-compiler thing)) - (drv (lower thing system target))) - (return `(,drv ,@sub-drv)))) - (input - (return input))) + (((? struct? thing) sub-drv ...) + (mlet* %store-monad ((lower -> (lookup-compiler thing)) + (drv (lower thing system target))) + (return `(,drv ,@sub-drv)))) + (input + (return input))) inputs)))) (define* (lower-reference-graphs graphs #:key system target) From 18ad5bff7a3835d620ada1572ffef8a9efc97372 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 29 Mar 2015 21:34:02 -0400 Subject: [PATCH 29/47] gnu: xbindkeys: Pass --build to configure. * gnu/packages/xdisorg.scm (xbindkeys)[arguments]: Pass --build to configure. --- gnu/packages/xdisorg.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm index 99e2fce926..bf15b38f09 100644 --- a/gnu/packages/xdisorg.scm +++ b/gnu/packages/xdisorg.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014 Andreas Enge -;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2014, 2015 Alex Kost ;;; Copyright © 2013, 2015 Ludovic Courtès @@ -26,6 +26,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (gnu packages) #:use-module (gnu packages compression) @@ -442,6 +443,13 @@ transparent text on your screen.") (inputs `(("libx11" ,libx11) ("guile" ,guile-2.0))) + (arguments `(#:configure-flags + '(;; FIXME: xbindkeys-1.8.6's config.guess fails on mips64el. + ,@(if (%current-target-system) + '() + (let ((triplet + (nix-system->gnu-triplet (%current-system)))) + (list (string-append "--build=" triplet))))))) (home-page "http://www.nongnu.org/xbindkeys/") (synopsis "Associate a combination of keys with a shell command") (description From e930c2a350ea7dd33df1293ea3b87c2206e9343c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 29 Mar 2015 21:35:34 -0400 Subject: [PATCH 30/47] gnu: liba52: Pass --build to configure. * gnu/packages/video.scm (liba52)[arguments]: Pass --build to configure. --- gnu/packages/video.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 4c3c3ec44b..bc589a6edb 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -24,6 +24,7 @@ #:use-module ((guix licenses) #:select (gpl2 gpl2+ gpl3+ lgpl2.1+ bsd-3 public-domain fsf-free isc)) + #:use-module (guix utils) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -93,6 +94,13 @@ (base32 "0czccp4fcpf2ykp16xcrzdfmnircz1ynhls334q374xknd5747d2")))) (build-system gnu-build-system) + (arguments `(#:configure-flags + '(;; FIXME: liba52-0.7.4's config.guess fails on mips64el. + ,@(if (%current-target-system) + '() + (let ((triplet + (nix-system->gnu-triplet (%current-system)))) + (list (string-append "--build=" triplet))))))) (home-page "http://liba52.sourceforge.net/") (synopsis "ATSC A/52 stream decoder") (description "liba52 is a library for decoding ATSC A/52 streams. The From 41fd23334d9932c978579576fd86c5f89894c015 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 30 Mar 2015 05:33:33 -0400 Subject: [PATCH 31/47] gnu: tzdata: Update to 2015b. * gnu/packages/base.scm (tzdata): Update to 2015b. --- gnu/packages/base.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index ac059870e2..89b2773867 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -611,7 +611,7 @@ command.") (define-public tzdata (package (name "tzdata") - (version "2014j") + (version "2015b") (source (origin (method url-fetch) (uri (string-append @@ -619,7 +619,7 @@ command.") version ".tar.gz")) (sha256 (base32 - "038fvj6zf51k6z9sbbxbj87ajaf69l3whal2vwshbm4l0qr71n52")))) + "0qmdr1yqqn94b5a54axwszfzimyxg27i6xsfmp0sswd3nfjw2sjm")))) (build-system gnu-build-system) (arguments '(#:tests? #f @@ -666,7 +666,7 @@ command.") version ".tar.gz")) (sha256 (base32 - "1qpd12imy7q5hb5fhk48mfw65s0xlrkmms0zr2gk0mj88qjn3m3z")))))) + "0xjxlgzva13y8qi3vfbb3nq5pii8ax9wi4yc7vj9134rbciz2s76")))))) (home-page "http://www.iana.org/time-zones") (synopsis "Database of current and historical time zones") (description "The Time Zone Database (often called tz or zoneinfo) From b47be0214d1cee6326bac70b485c27c4e2b9d9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Mon, 2 Mar 2015 01:06:35 +0100 Subject: [PATCH 32/47] gnu: portaudio: Patch for Audacity compatibility. * gnu/packages/audio.scm (portaudio): Add a patch for Audacity compatibility. * gnu/packages/patches/portaudio-audacity-compat.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 1 + gnu/packages/audio.scm | 19 +- .../patches/portaudio-audacity-compat.patch | 324 ++++++++++++++++++ 3 files changed, 341 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/portaudio-audacity-compat.patch diff --git a/gnu-system.am b/gnu-system.am index 46807b67c7..13e6ab62fb 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -499,6 +499,7 @@ dist_patch_DATA = \ gnu/packages/patches/pingus-sdl-libs-config.patch \ gnu/packages/patches/plotutils-libpng-jmpbuf.patch \ gnu/packages/patches/polkit-drop-test.patch \ + gnu/packages/patches/portaudio-audacity-compat.patch \ gnu/packages/patches/procps-make-3.82.patch \ gnu/packages/patches/pulseaudio-fix-mult-test.patch \ gnu/packages/patches/pybugz-encode-error.patch \ diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index dec167f917..aa94dda7c7 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -1088,15 +1088,28 @@ portions of LAME.") (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version) ".tgz")) (sha256 - (base32 "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g")))) + (base32 "0mwddk4qzybaf85wqfhxqlf0c5im9il8z03rd4n127k8y2jj9q4g")) + (patches (list (search-patch "portaudio-audacity-compat.patch"))))) (build-system gnu-build-system) (inputs ;; TODO: Add ASIHPI. `(("alsa-lib" ,alsa-lib) ("jack" ,jack-2))) (native-inputs - `(("pkg-config" ,pkg-config))) - (arguments '(#:tests? #f)) ;no 'check' target + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config))) + (arguments + '(#:phases + ;; Autoreconf is necessary because the audacity-compat patch modifies + ;; .in files. + (alist-cons-after + 'unpack 'autoreconf + (lambda _ + (zero? (system* "autoreconf" "-vif"))) + %standard-phases) + #:tests? #f)) ;no 'check' target (home-page "http://www.portaudio.com/") (synopsis "Audio I/O library") (description diff --git a/gnu/packages/patches/portaudio-audacity-compat.patch b/gnu/packages/patches/portaudio-audacity-compat.patch new file mode 100644 index 0000000000..9f239ada35 --- /dev/null +++ b/gnu/packages/patches/portaudio-audacity-compat.patch @@ -0,0 +1,324 @@ +Description: Add features needed to make portmixer work with audacity. +Author: Audacity Team +Last-Update: 2011-12-07 + +See . + +--- a/include/pa_win_ds.h ++++ b/include/pa_win_ds.h +@@ -89,6 +89,21 @@ + + }PaWinDirectSoundStreamInfo; + ++/** Retrieve the GUID of the input device. ++ ++ @param stream The stream to query. ++ ++ @return A pointer to the GUID, or NULL if none. ++*/ ++LPGUID PaWinDS_GetStreamInputGUID( PaStream* s ); ++ ++/** Retrieve the GUID of the output device. ++ ++ @param stream The stream to query. ++ ++ @return A pointer to the GUID, or NULL if none. ++*/ ++LPGUID PaWinDS_GetStreamOutputGUID( PaStream* s ); + + + #ifdef __cplusplus +--- a/include/portaudio.h ++++ b/include/portaudio.h +@@ -1146,6 +1146,15 @@ + signed long Pa_GetStreamWriteAvailable( PaStream* stream ); + + ++/** Retrieve the host type handling an open stream. ++ ++ @return Returns a non-negative value representing the host API type ++ handling an open stream or, a PaErrorCode (which are always negative) ++ if PortAudio is not initialized or an error is encountered. ++*/ ++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ); ++ ++ + /* Miscellaneous utilities */ + + +--- /dev/null ++++ b/include/pa_unix_oss.h +@@ -0,0 +1,104 @@ ++#ifndef PA_UNIX_OSS_H ++#define PA_UNIX_OSS_H ++ ++/* ++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $ ++ * PortAudio Portable Real-Time Audio Library ++ * OSS-specific extensions ++ * ++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files ++ * (the "Software"), to deal in the Software without restriction, ++ * including without limitation the rights to use, copy, modify, merge, ++ * publish, distribute, sublicense, and/or sell copies of the Software, ++ * and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * Any person wishing to distribute modifications to the Software is ++ * requested to send the modifications to the original developer so that ++ * they can be incorporated into the canonical version. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ */ ++ ++/** @file ++ * OSS-specific PortAudio API extension header file. ++ */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++const char *PaOSS_GetStreamInputDevice( PaStream *s ); ++ ++const char *PaOSS_GetStreamOutputDevice( PaStream *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif ++#ifndef PA_UNIX_OSS_H ++#define PA_UNIX_OSS_H ++ ++/* ++ * $Id: portaudio.patch,v 1.10 2009-06-30 04:52:59 llucius Exp $ ++ * PortAudio Portable Real-Time Audio Library ++ * OSS-specific extensions ++ * ++ * Copyright (c) 1999-2000 Ross Bencina and Phil Burk ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files ++ * (the "Software"), to deal in the Software without restriction, ++ * including without limitation the rights to use, copy, modify, merge, ++ * publish, distribute, sublicense, and/or sell copies of the Software, ++ * and to permit persons to whom the Software is furnished to do so, ++ * subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * Any person wishing to distribute modifications to the Software is ++ * requested to send the modifications to the original developer so that ++ * they can be incorporated into the canonical version. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ++ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF ++ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ++ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ * ++ */ ++ ++/** @file ++ * OSS-specific PortAudio API extension header file. ++ */ ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++const char *PaOSS_GetStreamInputDevice( PaStream *s ); ++ ++const char *PaOSS_GetStreamOutputDevice( PaStream *s ); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- a/src/common/pa_front.c ++++ b/src/common/pa_front.c +@@ -1216,8 +1216,10 @@ + hostApiInputParametersPtr, hostApiOutputParametersPtr, + sampleRate, framesPerBuffer, streamFlags, streamCallback, userData ); + +- if( result == paNoError ) ++ if( result == paNoError ) { + AddOpenStream( *stream ); ++ PA_STREAM_REP(*stream)->hostApiType = hostApi->info.type; ++ } + + + PA_LOGAPI(("Pa_OpenStream returned:\n" )); +@@ -1729,6 +1731,32 @@ + return result; + } + ++PaHostApiTypeId Pa_GetStreamHostApiType( PaStream* stream ) ++{ ++ PaError error = PaUtil_ValidateStreamPointer( stream ); ++ PaHostApiTypeId result; ++ ++#ifdef PA_LOG_API_CALLS ++ PaUtil_DebugPrint("Pa_GetStreamHostApiType called:\n" ); ++ PaUtil_DebugPrint("\tPaStream* stream: 0x%p\n", stream ); ++#endif ++ ++ if( error == paNoError ) ++ { ++ result = PA_STREAM_REP(stream)->hostApiType; ++ } ++ else ++ { ++ result = (PaHostApiTypeId) error; ++ } ++ ++#ifdef PA_LOG_API_CALLS ++ PaUtil_DebugPrint("Pa_GetStreamHostApiType returned:\n" ); ++ PaUtil_DebugPrint("\tPaError: %d ( %s )\n\n", result, Pa_GetErrorText( result ) ); ++#endif ++ ++ return result; ++} + + PaError Pa_GetSampleSize( PaSampleFormat format ) + { +--- a/src/common/pa_stream.c ++++ b/src/common/pa_stream.c +@@ -93,6 +93,8 @@ + streamRepresentation->streamInfo.inputLatency = 0.; + streamRepresentation->streamInfo.outputLatency = 0.; + streamRepresentation->streamInfo.sampleRate = 0.; ++ ++ streamRepresentation->hostApiType = 0; + } + + +--- a/src/common/pa_stream.h ++++ b/src/common/pa_stream.h +@@ -152,6 +152,7 @@ + PaStreamFinishedCallback *streamFinishedCallback; + void *userData; + PaStreamInfo streamInfo; ++ PaHostApiTypeId hostApiType; + } PaUtilStreamRepresentation; + + +--- a/src/hostapi/coreaudio/pa_mac_core_blocking.c ++++ b/src/hostapi/coreaudio/pa_mac_core_blocking.c +@@ -66,6 +66,9 @@ + #ifdef MOSX_USE_NON_ATOMIC_FLAG_BITS + # define OSAtomicOr32( a, b ) ( (*(b)) |= (a) ) + # define OSAtomicAnd32( a, b ) ( (*(b)) &= (a) ) ++#elif MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3 ++# define OSAtomicOr32( a, b ) BitOrAtomic( a, (UInt32 *) b ) ++# define OSAtomicAnd32( a, b ) BitAndAtomic( a, (UInt32 *) b ) + #else + # include + #endif +--- a/src/hostapi/alsa/pa_linux_alsa.c ++++ b/src/hostapi/alsa/pa_linux_alsa.c +@@ -611,6 +611,7 @@ + StreamDirection streamDir; + + snd_pcm_channel_area_t *channelAreas; /* Needed for channel adaption */ ++ int card; + } PaAlsaStreamComponent; + + /* Implementation specific stream structure */ +@@ -1806,6 +1807,7 @@ + { + PaError result = paNoError; + PaSampleFormat userSampleFormat = params->sampleFormat, hostSampleFormat = paNoError; ++ snd_pcm_info_t* pcmInfo; + assert( params->channelCount > 0 ); + + /* Make sure things have an initial value */ +@@ -1826,6 +1828,9 @@ + self->device = params->device; + + PA_ENSURE( AlsaOpen( &alsaApi->baseHostApiRep, params, streamDir, &self->pcm ) ); ++ ++ snd_pcm_info_alloca( &pcmInfo ); ++ self->card = snd_pcm_info_get_card( pcmInfo ); + self->nfds = alsa_snd_pcm_poll_descriptors_count( self->pcm ); + + PA_ENSURE( hostSampleFormat = PaUtil_SelectClosestAvailableFormat( GetAvailableFormats( self->pcm ), userSampleFormat ) ); +@@ -4519,9 +4524,7 @@ + /* XXX: More descriptive error? */ + PA_UNLESS( stream->capture.pcm, paDeviceUnavailable ); + +- alsa_snd_pcm_info_alloca( &pcmInfo ); +- PA_ENSURE( alsa_snd_pcm_info( stream->capture.pcm, pcmInfo ) ); +- *card = alsa_snd_pcm_info_get_card( pcmInfo ); ++ *card = stream->capture.card; + + error: + return result; +@@ -4537,9 +4540,7 @@ + /* XXX: More descriptive error? */ + PA_UNLESS( stream->playback.pcm, paDeviceUnavailable ); + +- alsa_snd_pcm_info_alloca( &pcmInfo ); +- PA_ENSURE( alsa_snd_pcm_info( stream->playback.pcm, pcmInfo ) ); +- *card = alsa_snd_pcm_info_get_card( pcmInfo ); ++ *card = stream->playback.card; + + error: + return result; +--- a/src/hostapi/oss/pa_unix_oss.c ++++ b/src/hostapi/oss/pa_unix_oss.c +@@ -2028,3 +2028,26 @@ + #endif + } + ++const char *PaOSS_GetStreamInputDevice( PaStream* s ) ++{ ++ PaOssStream *stream = (PaOssStream*)s; ++ ++ if( stream->capture ) ++ { ++ return stream->capture->devName; ++ } ++ ++ return NULL; ++} ++ ++const char *PaOSS_GetStreamOutputDevice( PaStream* s ) ++{ ++ PaOssStream *stream = (PaOssStream*)s; ++ ++ if( stream->playback ) ++ { ++ return stream->playback->devName; ++ } ++ ++ return NULL; ++} +--- a/configure.in ++++ b/configure.in +@@ -365,6 +365,7 @@ + DLL_LIBS="$DLL_LIBS -lossaudio" + LIBS="$LIBS -lossaudio" + fi ++ INCLUDES="$INCLUDES pa_unix_oss.h" + AC_DEFINE(PA_USE_OSS,1) + fi + From 147479c9182b4938f7e5536381a108923ae5bbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Fri, 20 Feb 2015 21:52:21 +0100 Subject: [PATCH 33/47] gnu: Add audacity. * gnu/packages/audacity.scm: New file. * gnu-system.am (GNU_SYSTEM_MODULES): Add it. * gnu/packages/patches/audacity-fix-ffmpeg-binding.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. --- gnu-system.am | 2 + gnu/packages/audacity.scm | 102 ++++++++++++++++++ .../patches/audacity-fix-ffmpeg-binding.patch | 32 ++++++ 3 files changed, 136 insertions(+) create mode 100644 gnu/packages/audacity.scm create mode 100644 gnu/packages/patches/audacity-fix-ffmpeg-binding.patch diff --git a/gnu-system.am b/gnu-system.am index 13e6ab62fb..d3e4dafc4e 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -38,6 +38,7 @@ GNU_SYSTEM_MODULES = \ gnu/packages/asciidoc.scm \ gnu/packages/aspell.scm \ gnu/packages/attr.scm \ + gnu/packages/audacity.scm \ gnu/packages/audio.scm \ gnu/packages/autogen.scm \ gnu/packages/autotools.scm \ @@ -369,6 +370,7 @@ dist_patch_DATA = \ gnu/packages/patches/ath9k-htc-firmware-binutils.patch \ gnu/packages/patches/ath9k-htc-firmware-gcc.patch \ gnu/packages/patches/ath9k-htc-firmware-objcopy.patch \ + gnu/packages/patches/audacity-fix-ffmpeg-binding.patch \ gnu/packages/patches/automake-skip-amhello-tests.patch \ gnu/packages/patches/avahi-localstatedir.patch \ gnu/packages/patches/avrdude-fix-libusb.patch \ diff --git a/gnu/packages/audacity.scm b/gnu/packages/audacity.scm new file mode 100644 index 0000000000..4f7bc686e3 --- /dev/null +++ b/gnu/packages/audacity.scm @@ -0,0 +1,102 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages audacity) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages audio) + #:use-module (gnu packages base) + #:use-module (gnu packages gtk) + #:use-module (gnu packages linux) + #:use-module (gnu packages mp3) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages python) + #:use-module (gnu packages xiph) + #:use-module (gnu packages xml) + #:use-module (gnu packages video) + #:use-module (gnu packages wxwidgets)) + +(define-public audacity + (package + (name "audacity") + (version "2.1.0") + (source + (origin + (method url-fetch) + (uri + (string-append + "mirror://sourceforge/audacity/audacity-minsrc-" version ".tar.xz")) + (sha256 + (base32 "1cs2w3fwqylpqmfwkvlgdx5lhclpckfil7pqibl37qlbnf4qvndh")) + (patches (list (search-patch "audacity-fix-ffmpeg-binding.patch"))))) + (build-system gnu-build-system) + (inputs + ;; TODO: Add portSMF and libwidgetextra once they're packaged. In-tree + ;; versions shipping with Audacity are used for now. + `(("wxwidgets" ,wxwidgets-2) + ("gtk" ,gtk+-2) + ("alsa-lib" ,alsa-lib) + ("jack" ,jack-2) + ("expat" ,expat) + ("ffmpeg" ,ffmpeg) + ("lame" ,lame) + ("flac" ,flac) + ("libid3tag" ,libid3tag) + ("libmad" ,libmad) + ("libsbsms" ,libsbsms) + ("libsndfile" ,libsndfile) + ("soundtouch" ,soundtouch) + ("soxr" ,soxr) ;replaces libsamplerate + ("twolame" ,twolame) + ("vamp" ,vamp) + ("libvorbis" ,libvorbis) + ("lv2" ,lv2) + ("lilv" ,lilv) + ("portaudio" ,portaudio))) + (native-inputs + `(("pkg-config" ,pkg-config) + ("python" ,python-2) + ("which" ,which))) + (arguments + '(#:configure-flags + (let ((libid3tag (assoc-ref %build-inputs "libid3tag")) + (libmad (assoc-ref %build-inputs "libmad"))) + (list + ;; Loading FFmpeg dynamically is problematic. + "--disable-dynamic-loading" + ;; libid3tag and libmad provide no .pc files, so pkg-config fails to + ;; find them. Force their inclusion. + (string-append "ID3TAG_CFLAGS=-I" libid3tag "/include") + (string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz") + (string-append "LIBMAD_CFLAGS=-I" libmad "/include") + (string-append "LIBMAD_LIBS=-L" libmad "/lib -lmad"))) + ;; The test suite is not "well exercised" according to the developers, + ;; and fails with various errors. See + ;; . + #:tests? #f)) + (home-page "http://audacity.sourceforge.net/") + (synopsis "Software for recording and editing sounds") + (description + "Audacity is a multi-track audio editor designed for recording, playing +and editing digital audio. It features digital effects and spectrum analysis +tools.") + (license license:gpl2+))) diff --git a/gnu/packages/patches/audacity-fix-ffmpeg-binding.patch b/gnu/packages/patches/audacity-fix-ffmpeg-binding.patch new file mode 100644 index 0000000000..d6d65338d9 --- /dev/null +++ b/gnu/packages/patches/audacity-fix-ffmpeg-binding.patch @@ -0,0 +1,32 @@ +This resolves some "declaration of C function conflicts with previous +declaration" errors during compilation. + +--- a/src/FFmpeg.h 2015-02-21 00:33:33.853857529 +0100 ++++ b/src/FFmpeg.h 2015-02-21 00:35:09.626497205 +0100 +@@ -688,7 +688,7 @@ + FFMPEG_FUNCTION_WITH_RETURN( + AVOutputFormat*, + av_oformat_next, +- (AVOutputFormat *f), ++ (const AVOutputFormat *f), + (f) + ); + FFMPEG_FUNCTION_WITH_RETURN( +@@ -755,7 +755,7 @@ + FFMPEG_FUNCTION_WITH_RETURN( + int, + av_fifo_size, +- (AVFifoBuffer *f), ++ (const AVFifoBuffer *f), + (f) + ); + FFMPEG_FUNCTION_WITH_RETURN( +@@ -801,7 +801,7 @@ + FFMPEG_FUNCTION_WITH_RETURN( + AVDictionaryEntry *, + av_dict_get, +- (AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags), ++ (const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags), + (m, key, prev, flags) + ); + FFMPEG_FUNCTION_WITH_RETURN( From 8d30be32fa01a191d341804b7614a722da950f84 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 30 Mar 2015 05:59:51 -0400 Subject: [PATCH 34/47] Revert "gnu: tzdata: Update to 2015b." This reverts commit 41fd23334d9932c978579576fd86c5f89894c015. --- gnu/packages/base.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 89b2773867..ac059870e2 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -611,7 +611,7 @@ command.") (define-public tzdata (package (name "tzdata") - (version "2015b") + (version "2014j") (source (origin (method url-fetch) (uri (string-append @@ -619,7 +619,7 @@ command.") version ".tar.gz")) (sha256 (base32 - "0qmdr1yqqn94b5a54axwszfzimyxg27i6xsfmp0sswd3nfjw2sjm")))) + "038fvj6zf51k6z9sbbxbj87ajaf69l3whal2vwshbm4l0qr71n52")))) (build-system gnu-build-system) (arguments '(#:tests? #f @@ -666,7 +666,7 @@ command.") version ".tar.gz")) (sha256 (base32 - "0xjxlgzva13y8qi3vfbb3nq5pii8ax9wi4yc7vj9134rbciz2s76")))))) + "1qpd12imy7q5hb5fhk48mfw65s0xlrkmms0zr2gk0mj88qjn3m3z")))))) (home-page "http://www.iana.org/time-zones") (synopsis "Database of current and historical time zones") (description "The Time Zone Database (often called tz or zoneinfo) From 96af558907fecb22086a4ebc260b20f34fb25335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 30 Mar 2015 15:20:55 +0200 Subject: [PATCH 35/47] elf: Add missing argument in 'elf-segment'. * guix/elf.scm (elf-segment): Add missing argument N. --- guix/elf.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/elf.scm b/guix/elf.scm index a4b0e819a5..4283dbd2e4 100644 --- a/guix/elf.scm +++ b/guix/elf.scm @@ -1,6 +1,6 @@ ;;; Guile ELF reader and writer -;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc. +;; Copyright (C) 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -571,6 +571,7 @@ ((4) parse-elf32-program-header) ((8) parse-elf64-program-header) (else (error "unhandled pointer size"))) + n (elf-bytes elf) (+ (elf-phoff elf) (* n (elf-phentsize elf))) (elf-byte-order elf))) From e9f1fa39a280cd2272a8a904f51fe478d4717cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 30 Mar 2015 15:37:35 +0200 Subject: [PATCH 36/47] gnu: Add missing copyright line. * gnu/packages/graphics.scm: Add copyright line for 87bafa0. --- gnu/packages/graphics.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index c92dd1b354..f574628698 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Ludovic Courtès +;;; Copyright © 2015 Tomáš Čech ;;; ;;; This file is part of GNU Guix. ;;; From f73b8e3d0a14961418255d53708bd10271ef5f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 31 Mar 2015 13:59:37 +0200 Subject: [PATCH 37/47] install: Create /var/tmp. Suggested by Mark H Weaver . * gnu/build/install.scm (directives): Add /var/tmp. --- gnu/build/install.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/build/install.scm b/gnu/build/install.scm index aa901f6971..51895d58ec 100644 --- a/gnu/build/install.scm +++ b/gnu/build/install.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -118,6 +118,7 @@ STORE." (directory "/bin") (directory "/tmp" 0 0 #o1777) ; sticky bit + (directory "/var/tmp" 0 0 #o1777) (directory "/root" 0 0) ; an exception (directory "/home" 0 0))) From 9af288a6805661627f964d9e9eae4518aaad266e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?= Date: Mon, 30 Mar 2015 10:37:11 +0200 Subject: [PATCH 38/47] gnu: ngircd: Fix test suite. * gnu/packages/messaging.scm (ngircd): Overwrite getpid.sh with a more reliable version. --- gnu/packages/messaging.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 462c500248..fd857b1ec3 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -201,7 +201,22 @@ dictionaries. HexChat can be extended with multiple addons.") 'configure 'post-configure (lambda _ (substitute* "src/ngircd/Makefile" - (("/bin/sh") (which "sh")))) + (("/bin/sh") (which "sh"))) + ;; The default getpid.sh does a sloppy grep over 'ps -ax' output, + ;; which fails arbitrarily. + (with-output-to-file "src/testsuite/getpid.sh" + (lambda () + (display + (string-append + "#!" (which "sh") "\n" + "ps -C \"$1\" -o pid=\n")))) + ;; Our variant of getpid.sh does not work for interpreter names if a + ;; shebang script is run directly as "./foo", so patch cases where + ;; the test suite relies on this. + (substitute* "src/testsuite/start-server.sh" + ;; It runs 'getpid.sh sh' to test if it works at all. Run it on + ;; 'make' instead. + (("getpid.sh sh") "getpid.sh make"))) %standard-phases))) (home-page "http://ngircd.barton.de/") (synopsis "Lightweight Internet Relay Chat server for small networks") From 8e913213d9d072ddf75c48b8db8f32b46d5a2a3c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 20 Mar 2015 16:17:55 +0100 Subject: [PATCH 39/47] gnu: Add cutadapt. * gnu/packages/bioinformatics.scm (cutadapt): New variable. --- gnu/packages/bioinformatics.scm | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index ca8dcb761a..883eb19f6a 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -19,6 +19,7 @@ (define-module (gnu packages bioinformatics) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) + #:use-module (guix utils) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) @@ -401,6 +402,46 @@ files between different genome assemblies. It supports most commonly used file formats including SAM/BAM, Wiggle/BigWig, BED, GFF/GTF, VCF.") (license license:gpl2+))) +(define-public cutadapt + (package + (name "cutadapt") + (version "1.8") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/marcelm/cutadapt/archive/v" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "161bp87y6gd6r5bmvjpn2b1k942i3fizfpa139f0jn6jv1wcp5h5")))) + (build-system python-build-system) + (arguments + ;; tests must be run after install + `(#:phases (alist-cons-after + 'install 'check + (lambda* (#:key inputs outputs #:allow-other-keys) + (setenv "PYTHONPATH" + (string-append + (getenv "PYTHONPATH") + ":" (assoc-ref outputs "out") + "/lib/python" + (string-take (string-take-right + (assoc-ref inputs "python") 5) 3) + "/site-packages")) + (zero? (system* "nosetests" "-P" "tests"))) + (alist-delete 'check %standard-phases)))) + (native-inputs + `(("python-cython" ,python-cython) + ("python-nose" ,python-nose) + ("python-setuptools" ,python-setuptools))) + (home-page "https://code.google.com/p/cutadapt/") + (synopsis "Remove adapter sequences from nucleotide sequencing reads") + (description + "Cutadapt finds and removes adapter sequences, primers, poly-A tails and +other types of unwanted sequence from high-throughput sequencing reads.") + (license license:expat))) + (define-public flexbar (package (name "flexbar") From de07c0db4a48cdedc28d7f5b2dcd368f1885e8c9 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 20 Mar 2015 16:50:33 +0100 Subject: [PATCH 40/47] gnu: Add vcftools. * gnu/packages/bioinformatics.scm (vcftools): New variable. --- gnu/packages/bioinformatics.scm | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 883eb19f6a..651018e0f5 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -970,3 +970,43 @@ chimeric (fusion) transcripts, and is also capable of mapping full-length RNA sequences.") ;; STAR is licensed under GPLv3 or later; htslib is MIT-licensed. (license license:gpl3+))) + +(define-public vcftools + (package + (name "vcftools") + (version "0.1.12b") + (source (origin + (method url-fetch) + (uri (string-append + "mirror://sourceforge/vcftools/vcftools_" + version ".tar.gz")) + (sha256 + (base32 + "148al9h7f8g8my2qdnpax51kdd2yjrivlx6frvakf4lz5r8j88wx")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no "check" target + #:make-flags (list + (string-append "PREFIX=" (assoc-ref %outputs "out")) + (string-append "MANDIR=" (assoc-ref %outputs "out") + "/share/man/man1")) + #:phases + (alist-cons-after + 'unpack 'patch-manpage-install + (lambda _ + (substitute* "Makefile" + (("cp \\$\\{PREFIX\\}/cpp/vcftools.1") "cp ./cpp/vcftools.1"))) + (alist-delete 'configure %standard-phases)))) + (inputs + `(("perl" ,perl) + ("zlib" ,zlib))) + (home-page "http://vcftools.sourceforge.net/") + (synopsis "Tools for working with VCF files") + (description + "VCFtools is a program package designed for working with VCF files, such +as those generated by the 1000 Genomes Project. The aim of VCFtools is to +provide easily accessible methods for working with complex genetic variation +data in the form of VCF files.") + ;; The license is declared as LGPLv3 in the README and + ;; at http://vcftools.sourceforge.net/license.html + (license license:lgpl3))) From 3cff95cbee7525a99347e3a3e9f2a9cebe55086e Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 31 Mar 2015 12:34:37 +0200 Subject: [PATCH 41/47] gnu: Add python-decorator. * gnu/packages/python.scm (python-decorator, python2-decorator): New variables. --- gnu/packages/python.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 23afec7950..f7eb478c3c 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -2837,6 +2837,34 @@ PNG, PostScript, PDF, and SVG file output.") (define-public python2-cairocffi (package-with-python2 python-cairocffi)) +(define-public python-decorator + (package + (name "python-decorator") + (version "3.4.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/source/d/decorator/decorator-" + version ".tar.gz")) + (sha256 + (base32 "0i2bnlkh0p9gs76hb28mafandcrig2fmv56w9ai6mshxwqn0083k")))) + (build-system python-build-system) + (arguments '(#:tests? #f)) ; no test target + (native-inputs + `(("python-setuptools" ,python-setuptools))) + (home-page "http://pypi.python.org/pypi/decorator/") + (synopsis "Python module to simplify usage of decorators") + (description + "The aim of the decorator module is to simplify the usage of decorators +for the average programmer, and to popularize decorators usage giving examples +of useful decorators, such as memoize, tracing, redirecting_stdout, locked, +etc. The core of this module is a decorator factory.") + (license license:expat))) + +(define-public python2-decorator + (package-with-python2 python-decorator)) + (define-public python-ipython (package (name "python-ipython") From 32f77c0445b811481e011674ba6cfdfb22ead3c1 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 31 Mar 2015 12:35:09 +0200 Subject: [PATCH 42/47] gnu: Add python-networkx. * gnu/packages/python.scm (python-networkx, python2-networkx): New variables. --- gnu/packages/python.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index f7eb478c3c..c5cae6de45 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3335,6 +3335,35 @@ interfaces in an easy and portable manner.") (define-public python2-netifaces (package-with-python2 python-netifaces)) +(define-public python-networkx + (package + (name "python-networkx") + (version "1.9.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/source/n/networkx/networkx-" + version ".tar.gz")) + (sha256 + (base32 "0n8wy0yq1kmdq4wh68mlhwhkndvwzx48lg41a1z0sxxms0wfp033")))) + (build-system python-build-system) + ;; python-decorator is needed at runtime + (propagated-inputs + `(("python-decorator" ,python-decorator))) + (native-inputs + `(("python-setuptools" ,python-setuptools) + ("python-nose" ,python-nose))) + (home-page "http://networkx.github.io/") + (synopsis "Python module for creating and manipulating graphs and networks") + (description + "NetworkX is a Python package for the creation, manipulation, and study +of the structure, dynamics, and functions of complex networks.") + (license bsd-3))) + +(define-public python2-networkx + (package-with-python2 python-networkx)) + (define-public snakemake (package (name "snakemake") From 49261e45d8a9e2ff42a10950306c92b547ea3e8f Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 31 Mar 2015 12:37:31 +0200 Subject: [PATCH 43/47] gnu: pbtranscript-tofu: Delete pre-built libraries. * gnu/packages/bioinformatics.scm (pbtranscript-tofu)[arguments]: Delete "build" directory and any shared objects after unpacking. --- gnu/packages/bioinformatics.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index 651018e0f5..f6db5a8e65 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -750,15 +750,18 @@ files and writing bioinformatics applications.") (chdir "pbtranscript-tofu/pbtranscript/") ;; Delete clutter (delete-file-recursively "dist/") + (delete-file-recursively "build/") (delete-file-recursively "setuptools_cython-0.2.1-py2.6.egg/") (delete-file-recursively "pbtools.pbtranscript.egg-info") (delete-file "Cython-0.20.1.tar.gz") (delete-file "setuptools_cython-0.2.1-py2.7.egg") (delete-file "setuptools_cython-0.2.1.tar.gz") (delete-file "setup.cfg") + (for-each delete-file + (find-files "." "\\.so$")) ;; files should be writable for install phase (for-each (lambda (f) (chmod f #o755)) - (find-files "." "\\.py"))) + (find-files "." "\\.py$"))) %standard-phases))) (inputs `(("python-cython" ,python2-cython) From c5372108f28a1e7d1114c6c7d73016531eb4f451 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 31 Mar 2015 13:46:27 +0200 Subject: [PATCH 44/47] gnu: pbtranscript-tofu: Add missing inputs. * gnu/packages/bioinformatics.scm (pbtranscript-tofu)[inputs]: Add missing runtime inputs. --- gnu/packages/bioinformatics.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index f6db5a8e65..3725f3ffe5 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -767,6 +767,8 @@ files and writing bioinformatics applications.") `(("python-cython" ,python2-cython) ("python-numpy" ,python2-numpy) ("python-bx-python" ,python2-bx-python) + ("python-networkx" ,python2-networkx) + ("python-scipy" ,python2-scipy) ("python-pbcore" ,python2-pbcore))) (native-inputs `(("python-nose" ,python2-nose) From fbbcf6989b63df38765c327d1fbaed3f7260a660 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 31 Mar 2015 14:30:05 -0400 Subject: [PATCH 45/47] gnu: xterm: Update to 317. * gnu/packages/xorg.scm (xterm): Update to 317. --- gnu/packages/xorg.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 776c858c16..cfb4cc1643 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -4884,14 +4884,14 @@ user-friendly mechanism to start the X server.") (define-public xterm (package (name "xterm") - (version "315") + (version "317") (source (origin (method url-fetch) (uri (string-append "ftp://ftp.invisible-island.net/xterm/" "xterm-" version ".tgz")) (sha256 (base32 - "00kxg36hzp011x98ib6x503pbhj1ldh6hb82l5x3a68s554h1rpy")))) + "0v9mirqws1vb8wxbdgn1w166ln7xmapg1913c7kzjs3mwkdv1rfj")))) (build-system gnu-build-system) (arguments '(#:configure-flags '("--enable-wide-chars" "--enable-256-color" From 4e7b6b4838318ca127ae588a7a28c8608b0c8721 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 31 Mar 2015 21:59:05 +0200 Subject: [PATCH 46/47] tests: Fix module name for 'lint'. * tests/lint.scm: Change module name to 'test-lint'. --- tests/lint.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/lint.scm b/tests/lint.scm index c0599224b7..2312b80934 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -18,8 +18,7 @@ ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . - -(define-module (test-packages) +(define-module (test-lint) #:use-module (guix tests) #:use-module (guix download) #:use-module (guix build-system gnu) From 15aa2c38429a5785ed08519c88ff89a0b7027f0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 31 Mar 2015 22:10:08 +0200 Subject: [PATCH 47/47] Add (guix build gremlin). * guix/build/gremlin.scm, tests/gremlin.scm: New files. * Makefile.am (MODULES): Add guix/build/gremlin.scm. (SCM_TESTS): Add tests/gremlin.scm. --- Makefile.am | 2 + guix/build/gremlin.scm | 236 +++++++++++++++++++++++++++++++++++++++++ tests/gremlin.scm | 57 ++++++++++ 3 files changed, 295 insertions(+) create mode 100644 guix/build/gremlin.scm create mode 100644 tests/gremlin.scm diff --git a/Makefile.am b/Makefile.am index 4a1f8d0a88..cf709986ed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -82,6 +82,7 @@ MODULES = \ guix/build/cvs.scm \ guix/build/svn.scm \ guix/build/syscalls.scm \ + guix/build/gremlin.scm \ guix/build/emacs-utils.scm \ guix/build/graft.scm \ guix/packages.scm \ @@ -178,6 +179,7 @@ SCM_TESTS = \ tests/union.scm \ tests/profiles.scm \ tests/syscalls.scm \ + tests/gremlin.scm \ tests/lint.scm if HAVE_GUILE_JSON diff --git a/guix/build/gremlin.scm b/guix/build/gremlin.scm new file mode 100644 index 0000000000..e8429129e1 --- /dev/null +++ b/guix/build/gremlin.scm @@ -0,0 +1,236 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build gremlin) + #:use-module (guix elf) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-26) + #:use-module (system foreign) + #:use-module (rnrs bytevectors) + #:use-module (rnrs io ports) + #:export (elf-dynamic-info + elf-dynamic-info? + elf-dynamic-info-sopath + elf-dynamic-info-needed + elf-dynamic-info-rpath + elf-dynamic-info-runpath + + validate-needed-in-runpath)) + +;;; Commentary: +;;; +;;; A gremlin is sort-of like an elf, you know, and this module provides tools +;;; to deal with dynamic-link information from ELF files. +;;; +;;; Code: + +(define (dynamic-link-segment elf) + "Return the 'PT_DYNAMIC' segment of ELF--i.e., the segment that contains +dynamic linking information." + (find (lambda (segment) + (= (elf-segment-type segment) PT_DYNAMIC)) + (elf-segments elf))) + +(define (word-reader size byte-order) + "Return a procedure to read a word of SIZE bytes according to BYTE-ORDER." + (case size + ((8) + (lambda (bv index) + (bytevector-u64-ref bv index byte-order))) + ((4) + (lambda (bv index) + (bytevector-u32-ref bv index byte-order))))) + + +;; Dynamic entry: +;; +;; typedef struct +;; { +;; Elf64_Sxword d_tag; /* Dynamic entry type */ +;; union +;; { +;; Elf64_Xword d_val; /* Integer value */ +;; Elf64_Addr d_ptr; /* Address value */ +;; } d_un; +;; } Elf64_Dyn; + +(define (raw-dynamic-entries elf segment) + "Return as a list of type/value pairs all the dynamic entries found in +SEGMENT, the 'PT_DYNAMIC' segment of ELF. In the result, each car is a DT_ +value, and the interpretation of the cdr depends on the type." + (define start + (elf-segment-offset segment)) + (define bytes + (elf-bytes elf)) + (define word-size + (elf-word-size elf)) + (define byte-order + (elf-byte-order elf)) + (define read-word + (word-reader word-size byte-order)) + + (let loop ((offset 0) + (result '())) + (if (>= offset (elf-segment-memsz segment)) + (reverse result) + (let ((type (read-word bytes (+ start offset))) + (value (read-word bytes (+ start offset word-size)))) + (if (= type DT_NULL) ;finished? + (reverse result) + (loop (+ offset (* 2 word-size)) + (alist-cons type value result))))))) + +(define (vma->offset elf vma) + "Convert VMA, a virtual memory address, to an offset within ELF. + +Do that by looking at the loadable program segment (PT_LOAD) of ELF that +contains VMA and by taking into account that segment's virtual address and +offset." + ;; See 'offset_from_vma' in Binutils. + (define loads + (filter (lambda (segment) + (= (elf-segment-type segment) PT_LOAD)) + (elf-segments elf))) + + (let ((load (find (lambda (segment) + (let ((vaddr (elf-segment-vaddr segment))) + (and (>= vma vaddr) + (< vma (+ (elf-segment-memsz segment) + vaddr))))) + loads))) + (+ (- vma (elf-segment-vaddr load)) + (elf-segment-offset load)))) + +(define (dynamic-entries elf segment) + "Return all the dynamic entries found in SEGMENT, the 'PT_DYNAMIC' segment +of ELF, as a list of type/value pairs. The type is a DT_ value, and the value +may be a string or an integer depending on the entry type (for instance, the +value of DT_NEEDED entries is a string.)" + (define entries + (raw-dynamic-entries elf segment)) + + (define string-table-offset + (any (match-lambda + ((type . value) + (and (= type DT_STRTAB) value)) + (_ #f)) + entries)) + + (define (interpret-dynamic-entry type value) + (cond ((memv type (list DT_NEEDED DT_SONAME DT_RPATH DT_RUNPATH)) + (if string-table-offset + (pointer->string + (bytevector->pointer (elf-bytes elf) + (vma->offset + elf + (+ string-table-offset value)))) + value)) + (else + value))) + + (map (match-lambda + ((type . value) + (cons type (interpret-dynamic-entry type value)))) + entries)) + + +;;; +;;; High-level interface. +;;; + +(define-record-type + (%elf-dynamic-info soname needed rpath runpath) + elf-dynamic-info? + (soname elf-dynamic-info-soname) + (needed elf-dynamic-info-needed) + (rpath elf-dynamic-info-rpath) + (runpath elf-dynamic-info-runpath)) + +(define search-path->list + (let ((not-colon (char-set-complement (char-set #\:)))) + (lambda (str) + "Split STR on ':' characters." + (string-tokenize str not-colon)))) + +(define (elf-dynamic-info elf) + "Return dynamic-link information for ELF as an object, or +#f if ELF lacks dynamic-link information." + (match (dynamic-link-segment elf) + (#f #f) + ((? elf-segment? dynamic) + (let ((entries (dynamic-entries elf dynamic))) + (%elf-dynamic-info (assv-ref entries DT_SONAME) + (filter-map (match-lambda + ((type . value) + (and (= type DT_NEEDED) value)) + (_ #f)) + entries) + (or (and=> (assv-ref entries DT_RPATH) + search-path->list) + '()) + (or (and=> (assv-ref entries DT_RUNPATH) + search-path->list) + '())))))) + +(define %libc-libraries + ;; List of libraries as of glibc 2.21 (there are more but those are + ;; typically mean to be LD_PRELOADed and thus do not appear as NEEDED.) + '("libanl.so" + "libcrypt.so" + "libc.so" + "libdl.so" + "libm.so" + "libpthread.so" + "libresolv.so" + "librt.so" + "libutil.so")) + +(define (libc-library? lib) + "Return #t if LIB is one of the libraries shipped with the GNU C Library." + (find (lambda (libc-lib) + (string-prefix? libc-lib lib)) + %libc-libraries)) + +(define* (validate-needed-in-runpath file + #:key (always-found? libc-library?)) + "Return #t if all the libraries listed as FILE's 'DT_NEEDED' entries are +present in its RUNPATH, or if FILE lacks dynamic-link information. Return #f +otherwise. Libraries whose name matches ALWAYS-FOUND? are considered to be +always available." + (let* ((elf (call-with-input-file file + (compose parse-elf get-bytevector-all))) + (dyninfo (elf-dynamic-info elf))) + (when dyninfo + (let* ((runpath (elf-dynamic-info-runpath dyninfo)) + (needed (remove always-found? + (elf-dynamic-info-needed dyninfo))) + (not-found (remove (cut search-path runpath <>) + needed))) + (for-each (lambda (lib) + (format (current-error-port) + "error: '~a' depends on '~a', which cannot \ +be found in RUNPATH ~s~%" + file lib runpath)) + not-found) + ;; (when (null? not-found) + ;; (format (current-error-port) "~a is OK~%" file)) + (null? not-found))))) + +;;; gremlin.scm ends here diff --git a/tests/gremlin.scm b/tests/gremlin.scm new file mode 100644 index 0000000000..225a72ff9f --- /dev/null +++ b/tests/gremlin.scm @@ -0,0 +1,57 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2015 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (test-gremlin) + #:use-module (guix elf) + #:use-module (guix build utils) + #:use-module (guix build gremlin) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-64) + #:use-module (rnrs io ports) + #:use-module (ice-9 match)) + +(define %guile-executable + (match (command-line) + ((program . _) + (and (file-exists? program) (elf-file? program) + program)) + (_ + #f))) + +(define read-elf + (compose parse-elf get-bytevector-all)) + + +(test-begin "gremlin") + +(unless %guile-executable (test-skip 1)) +(test-assert "elf-dynamic-info-needed, executable" + (let* ((elf (call-with-input-file %guile-executable read-elf)) + (dyninfo (elf-dynamic-info elf))) + (or (not dyninfo) ;static executable + (lset<= string=? + (list (string-append "libguile-" (effective-version)) + "libgc" "libunistring" "libffi") + (map (lambda (lib) + (string-take lib (string-contains lib ".so"))) + (elf-dynamic-info-needed dyninfo)))))) + +(test-end "gremlin") + + +(exit (= (test-runner-fail-count (test-runner-current)) 0))