summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2016-04-27 10:18:53 -0500
committerEric Bavier <bavier@member.fsf.org>2016-04-29 16:42:10 -0500
commitf36a1ebaab67bd05a62af990312d43a845daa9f2 (patch)
tree573022364ffa7c160fb0cde42855844c4d3acc3c
parent3b13c3c03ce04ef68b38c87bd171892a9b105347 (diff)
downloadguix-f36a1ebaab67bd05a62af990312d43a845daa9f2.tar.gz
gnu: Add Fossil.
* gnu/packages/version-control.scm (fossil): New variable.
* gnu/packages/patches/fossil-test-fixes.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/fossil-test-fixes.patch189
-rw-r--r--gnu/packages/version-control.scm80
3 files changed, 267 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 9e31ef9a4b..9308c38758 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -479,6 +479,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/fltk-shared-lib-defines.patch		\
   gnu/packages/patches/fltk-xfont-on-demand.patch		\
   gnu/packages/patches/fontforge-svg-modtime.patch		\
+  gnu/packages/patches/fossil-test-fixes.patch			\
   gnu/packages/patches/freeimage-CVE-2015-0852.patch		\
   gnu/packages/patches/gawk-fts-test.patch			\
   gnu/packages/patches/gawk-shell.patch				\
diff --git a/gnu/packages/patches/fossil-test-fixes.patch b/gnu/packages/patches/fossil-test-fixes.patch
new file mode 100644
index 0000000000..e6c9f3dd74
--- /dev/null
+++ b/gnu/packages/patches/fossil-test-fixes.patch
@@ -0,0 +1,189 @@
+From upstream commit https://www.fossil-scm.org/fossil/info/19c216391a0ad79e
+
+--- fossil-src-1.34/test/file1.test
++++ fossil-src-1.34/test/file1.test
+@@ -15,10 +15,12 @@
+ #
+ ############################################################################
+ #
+ # File utilities
+ #
++
++repo_init
+ 
+ proc simplify-name {testname args} {
+   set i 1
+   foreach {path result} $args {
+     fossil test-simplify-name $path
+@@ -65,10 +67,13 @@
+ 
+ if {$::tcl_platform(os)=="Windows NT"} {
+   simplify-name 108 //?/a:/a/b a:/a/b //?/UNC/a/b //a/b //?/ {}
+   simplify-name 109 \\\\?\\a:\\a\\b a:/a/b \\\\?\\UNC\\a\\b //a/b \\\\?\\ {}
+ }
++
++# This is needed because we are now running outside of the Fossil checkout.
++file mkdir file1; cd file1
+ 
+ # Those directories are only needed for the testcase being able to "--chdir" to it.
+ file mkdir test1
+ file mkdir test1/test2
+
+From upstream commit https://www.fossil-scm.org/fossil/info/ad6de6383391bd4d
+ 
+--- fossil-src-1.34/test/utf.test
++++ fossil-src-1.34/test/utf.test
+@@ -39,26 +39,29 @@
+     test utf-check-$testname.$i {$::RESULT eq $result}
+     incr i
+   }
+ }
+ 
++unset -nocomplain enc
+ array set enc [list     \
+       0 binary          \
+       1 binary          \
+       2 unicode         \
+       3 unicode-reverse \
+ ]
+ 
++unset -nocomplain bom
+ array set bom [list                                         \
+       0 ""                                                  \
+       1 \xEF\xBB\xBF                                        \
+       2 [expr {$tcl_platform(byteOrder) eq "littleEndian" ? \
+             "\xFF\xFE" : "\xFE\xFF"}]                       \
+       3 [expr {$tcl_platform(byteOrder) eq "littleEndian" ? \
+             "\xFE\xFF" : "\xFF\xFE"}]                       \
+ ]
+ 
++unset -nocomplain data
+ array set data [list                          \
+       0 ""                                    \
+       1 \r                                    \
+       2 \n                                    \
+       3 \r\n                                  \
+@@ -239,10 +242,11 @@
+     178 \xF4\x90\x80\x80\r                    \
+     179 \xF4\x90\x80\x80\n                    \
+     180 \xF4\x90\x80\x80\r\n                  \
+ ]
+ 
++unset -nocomplain extraData
+ array set extraData [list                     \
+       0 ""                                    \
+       1 Z                                     \
+ ]
+
+Backport from upstream https://www.fossil-scm.org/fossil/info/60285f5876512817
+with additional non-zero exit in case of failures.
+
+--- fossil-src-1.34/test/merge6.test
++++ fossil-src-1.34/test/merge6.test
+@@ -62,6 +62,6 @@
+ fossil ls
+ 
+ test merge_multi-4 {[normalize_result] eq {f1
+ f2
+ f3
+-f4}}
++f4}} knownBug
+
+--- fossil-src-1.34/test/merge_renames.test
++++ fossil-src-1.34/test/merge_renames.test
+@@ -156,13 +156,13 @@
+ }
+ 
+ if {$deletes!=0} {
+     # failed
+     protOut "Error, the merge should not delete any file"
+-    test merge_renames-2 0
++    test merge_renames-3 0
+ } else {
+-    test merge_renames-2 1
++    test merge_renames-3 1
+ }
+ 
+ ######################################
+ #  Test 4                            #
+ #  Reported: Ticket [67176c3aa4]     #
+@@ -198,14 +198,14 @@
+ 
+ fossil ls
+ 
+ test merge_renames-5 {[normalize_result] eq {f1
+ f2
+-f3}}
++f3}} knownBug
+ 
+ ######################################
+ #
+ # Tests for troubles not specifically linked with renames but that I'd like to
+ # write:
+ #  [c26c63eb1b] - 'merge --backout' does not handle conflicts properly
+ #  [953031915f] - Lack of warning when overwriting extra files
+ #  [4df5f38f1e] - Troubles merging a file delete with a file change
+
+--- fossil-src-1.34/test/tester.tcl
++++ fossil-src-1.34/test/tester.tcl
+@@ -58,10 +58,18 @@
+   set VERBOSE 1
+   set argv [lreplace $argv $i $i]
+ } else {
+   set VERBOSE 0
+ }
++
++set i [lsearch $argv -strict]
++if {$i>=0} {
++  set STRICT 1
++  set argv [lreplace $argv $i $i]
++} else {
++  set STRICT 0
++}
+ 
+ if {[llength $argv]==0} {
+   foreach f [lsort [glob $testdir/*.test]] {
+     set base [file root [file tail $f]]
+     lappend argv $base
+@@ -327,20 +335,30 @@
+ }
+ 
+ # Perform a test
+ #
+ set test_count 0
+-proc test {name expr} {
++proc test {name expr {constraints ""}} {
+   global bad_test test_count
+   incr test_count
++  set knownBug [expr {"knownBug" in $constraints}]
+   set r [uplevel 1 [list expr $expr]]
+   if {$r} {
+-    protOut "test $name OK"
++    if {$knownBug && !$::STRICT} {
++      protOut "test $name OK (knownBug)?"
++    } else {
++      protOut "test $name OK"
++    }
+   } else {
+-    protOut "test $name FAILED!"
+-    lappend bad_test $name
+-    if {$::HALT} exit
++    if {$knownBug && !$::STRICT} {
++      protOut "test $name FAILED (knownBug)!"
++    } else {
++      protOut "test $name FAILED!"
++      if {$::VERBOSE} {protOut "RESULT: $RESULT"}
++      lappend bad_test $name
++      if {$::HALT} exit
++    }
+   }
+ }
+ set bad_test {}
+ 
+ # Return a random string N characters long.
+@@ -445,4 +455,5 @@
+ protOut "***** Final result: $nErr errors out of $test_count tests"
+ if {$nErr>0} {
+   protOut "***** Failures: $bad_test"
++  exit 1
+ }
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 117d01d5d0..9107369482 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2014, 2016 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Kyle Meyer <kyle@kyleam.com>
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
@@ -29,7 +29,7 @@
   #:use-module ((guix licenses)
                 #:select (asl2.0 bsd-2
                           gpl1+ gpl2 gpl2+ gpl3+ lgpl2.1
-                          x11-style))
+                          public-domain x11-style))
   #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -38,7 +38,6 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
-  #:use-module (guix build utils)
   #:use-module (gnu packages apr)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages asciidoc)
@@ -1125,3 +1124,78 @@ Mercurial, Bazaar, Darcs, CVS, Fossil, and Veracity.")
      "This package allows you to use your hubic account as a \"special
 repository\" with git-annex.")
     (license gpl3+)))
+
+(define-public fossil
+  (package
+    (name "fossil")
+    (version "1.34")
+    (source
+     (origin
+       (method url-fetch)
+       ;; Upstream source affected by
+       ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20962
+       (uri (string-append
+             "https://web.archive.org/web/20160402202958/"
+             "https://www.fossil-scm.org/download/fossil-src-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "17x4vgjcfihwmq195qg32irp50panvjqfpvhqydfvv4ghwzbi9jk"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Commit 0a2ebe57 on 2015-08-03 18:35:53 changed output formatting
+           ;; for some commands, but affected tests were not updated.  Use
+           ;; substitute here, which is more concise than patching.
+           (substitute* "test/clean.test"
+             (("NEW ") "NEW    "))
+           (substitute* '("test/revert.test" "test/mv-rm.test")
+             (("REVERTED:") "REVERT  ")
+             (("DELETE:")   "DELETE  ")
+             (("UNMANAGE:") "UNMANAGE "))
+           ;; Fix use of __DATE__ and __TIME__
+           (substitute* "src/main.c"
+             (("Compiled on %s %s") "Compiled")
+             (("__DATE__, __TIME__, ") ""))
+           #t))
+       (patches (list (search-patch "fossil-test-fixes.patch")))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("tcl" ,tcl)                     ;for configuration only
+       ("which" ,which)                 ;for tests only
+       ("ed" ,ed)))                     ;ditto
+    (inputs
+     `(("openssl" ,openssl)
+       ("zlib" ,zlib)
+       ("sqlite" ,sqlite)))
+    (arguments
+     `(#:configure-flags (list "--with-openssl=auto"
+                               "--disable-internal-sqlite")
+       #:test-target "test"
+       #:phases (modify-phases %standard-phases
+                  (replace 'configure
+                    (lambda* (#:key outputs (configure-flags '())
+                                    #:allow-other-keys)
+                      ;; The 'configure' script is not an autoconf script and
+                      ;; chokes on unrecognized options.
+                      (zero? (apply system*
+                                    "./configure"
+                                    (string-append "--prefix="
+                                                   (assoc-ref outputs "out"))
+                                    configure-flags))))
+                  (add-before 'check 'test-setup
+                    (lambda _
+                      (setenv "USER" "guix")
+                      (setenv "TZ" "UTC")
+                      ;; Fixing the th1 test would require many backports, so
+                      ;; just disable for now.
+                      (delete-file "test/th1.test")
+                      #t)))))
+    (home-page "https://fossil-scm.org")
+    (synopsis "Software configuration management system")
+    (description
+     "Fossil is a distributed source control management system which supports
+access and administration over HTTP CGI or via a built-in HTTP server.  It has
+a built-in wiki, built-in file browsing, built-in tickets system, etc.")
+    (license (list public-domain        ;src/miniz.c, src/shell.c
+                   bsd-2))))