forked from pool/joker
Add reproducible.patch for deterministic output order
also: use autosetup OBS-URL: https://build.opensuse.org/package/show/devel:languages:clojure/joker?expand=0&rev=13
This commit is contained in:
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.osc
|
4
_service
Normal file
4
_service
Normal file
@@ -0,0 +1,4 @@
|
||||
<services>
|
||||
<service name="go_modules" mode="disabled">
|
||||
</service>
|
||||
</services>
|
3
joker-1.3.5.tar.gz
Normal file
3
joker-1.3.5.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f807a7378c78510fd7eba13607c3ec06c405ed08cc0605fade0fe2f7adeac101
|
||||
size 509709
|
3
joker-1.4.0.tar.gz
Normal file
3
joker-1.4.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8744e077e420a40a78c215fe9c61adad2aa59e8a985ec5d59aeb75f93b2706f3
|
||||
size 510798
|
49
joker.changes
Normal file
49
joker.changes
Normal file
@@ -0,0 +1,49 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 27 11:33:37 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
- Add reproducible.patch for deterministic output order
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 30 10:14:54 UTC 2024 - Andrea Manzini <andrea.manzini@suse.com>
|
||||
|
||||
- Update to verson 1.4.0
|
||||
* Added joker.url/parse-query function.
|
||||
* Added joker.io/read function.
|
||||
* Fixes Close file in load-file
|
||||
|
||||
- Added unit test run in the build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 30 16:58:24 UTC 2024 - Jochen Breuer <brejoc@gmail.com> - 1.3.5
|
||||
|
||||
- Update to version 1.3.5
|
||||
* joker.json/write-string serializes empty collections as null: gh#498
|
||||
* Updated vendor archive
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 3 20:48:36 UTC 2024 - Jochen Breuer <brejoc@gmail.com> - 1.3.4
|
||||
|
||||
- Update to version 1.3.4
|
||||
* Added joker.time/day-of-year function.
|
||||
* Updated vendor archive
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 21 20:23:55 UTC 2023 - Jochen Breuer <brejoc@gmail.com> - 1.3.3
|
||||
|
||||
- Update to version 1.3.3
|
||||
* Updated vendor archive
|
||||
* Create a_data.go in a reproducible way (thanks @bmwiedemann !)
|
||||
* add abs to cljs (thanks @harold !)
|
||||
* Bump golang.org/x/crypto from 0.14.0 to 0.17.0
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 3 08:55:52 UTC 2023 - Jochen Breuer <brejoc@gmail.com> - 1.3.1
|
||||
|
||||
- Update to version 1.3.1
|
||||
* Updated vendor archive
|
||||
* Linter improvements: add parse-uuid to cljs (gh#489)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 4 18:33:29 UTC 2023 - Jochen Breuer <brejoc@gmail.com> - 1.3.0
|
||||
|
||||
- Initial commit of Joker version 1.3.0 including vendor archive
|
58
joker.spec
Normal file
58
joker.spec
Normal file
@@ -0,0 +1,58 @@
|
||||
#
|
||||
# spec file for package joker
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: joker
|
||||
Version: 1.4.0
|
||||
Release: 0
|
||||
Summary: Small Clojure interpreter, linter and formatter written in Go
|
||||
License: EPL-1.0
|
||||
URL: https://joker-lang.org
|
||||
Source0: https://github.com/candid82/joker/archive/refs/tags/v%{version}.tar.gz#/joker-%{version}.tar.gz
|
||||
Source1: vendor.tar.gz
|
||||
# PATCH-FIX-UPSTREAM https://github.com/candid82/joker/issues/491
|
||||
Patch0: reproducible.patch
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mageia}
|
||||
BuildRequires: go-rpm-macros
|
||||
%else
|
||||
BuildRequires: golang-packaging
|
||||
BuildRequires: golang(API) >= 1.18
|
||||
%endif
|
||||
|
||||
%description
|
||||
Joker is a small Clojure interpreter, linter and formatter written in Go.
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
tar -zxf %{SOURCE1}
|
||||
|
||||
%build
|
||||
GO111MODULE=on CGO_ENABLED=0 go generate ./...
|
||||
GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -o %{name} -buildmode=pie \
|
||||
-ldflags "-s -w"
|
||||
|
||||
%install
|
||||
install -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}
|
||||
|
||||
%check
|
||||
./all-tests.sh
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%{_bindir}/%{name}
|
||||
|
||||
%changelog
|
92
reproducible.patch
Normal file
92
reproducible.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
From d2817bb18cd9cc0274460113a97dc87f2613d1ad Mon Sep 17 00:00:00 2001
|
||||
From: Roman Bataev <roman@bataev.me>
|
||||
Date: Sat, 14 Sep 2024 18:45:46 -0400
|
||||
Subject: [PATCH] Make build stable.
|
||||
|
||||
Fixes https://github.com/candid82/joker/issues/491
|
||||
---
|
||||
core/pack.go | 45 +++++++++++++++++++++++++++++++++++++++++----
|
||||
go.mod | 2 +-
|
||||
2 files changed, 42 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/core/pack.go b/core/pack.go
|
||||
index 01ceac9b0..dea1db5fc 100644
|
||||
--- a/core/pack.go
|
||||
+++ b/core/pack.go
|
||||
@@ -4,6 +4,9 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
+ "maps"
|
||||
+ "slices"
|
||||
+ "sort"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -77,16 +80,50 @@ func NewPackEnv() *PackEnv {
|
||||
}
|
||||
}
|
||||
|
||||
+type BindingPair struct {
|
||||
+ binding *Binding
|
||||
+ index int
|
||||
+}
|
||||
+type ByIndex []BindingPair
|
||||
+
|
||||
+func (a ByIndex) Len() int { return len(a) }
|
||||
+func (a ByIndex) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
+func (a ByIndex) Less(i, j int) bool {
|
||||
+ return a[i].index < a[j].index
|
||||
+}
|
||||
+
|
||||
+type ByString []*string
|
||||
+
|
||||
+func (a ByString) Len() int { return len(a) }
|
||||
+func (a ByString) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
|
||||
+func (a ByString) Less(i, j int) bool {
|
||||
+ if a[i] == nil {
|
||||
+ return true
|
||||
+ }
|
||||
+ if a[j] == nil {
|
||||
+ return false
|
||||
+ }
|
||||
+ return *a[i] < *a[j]
|
||||
+}
|
||||
+
|
||||
func (env *PackEnv) Pack(p []byte) []byte {
|
||||
var bp []byte
|
||||
bp = appendInt(bp, len(env.Bindings))
|
||||
+ var bindings []BindingPair
|
||||
for k, v := range env.Bindings {
|
||||
- bp = appendInt(bp, v)
|
||||
- bp = k.Pack(bp, env)
|
||||
+ bindings = append(bindings, BindingPair{k, v})
|
||||
}
|
||||
+ sort.Sort(ByIndex(bindings))
|
||||
+ for _, pair := range bindings {
|
||||
+ bp = appendInt(bp, pair.index)
|
||||
+ bp = pair.binding.Pack(bp, env)
|
||||
+ }
|
||||
+
|
||||
p = appendInt(p, len(env.Strings))
|
||||
- for k, v := range env.Strings {
|
||||
- p = appendUint16(p, v)
|
||||
+ stringKeys := slices.Collect(maps.Keys(env.Strings))
|
||||
+ sort.Sort(ByString(stringKeys))
|
||||
+ for _, k := range stringKeys {
|
||||
+ p = appendUint16(p, env.Strings[k])
|
||||
if k == nil {
|
||||
p = appendInt(p, -1)
|
||||
} else {
|
||||
diff --git a/go.mod b/go.mod
|
||||
index 253fe40e2..74113364b 100644
|
||||
--- a/go.mod
|
||||
+++ b/go.mod
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/candid82/joker
|
||||
|
||||
-go 1.20
|
||||
+go 1.23
|
||||
|
||||
require (
|
||||
github.com/candid82/liner v1.4.0
|
3
vendor.tar.gz
Normal file
3
vendor.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3eda225ac6c03a67b03bdfc9c26b22f6aa1f13eb752763a558bf926511996dce
|
||||
size 2562421
|
Reference in New Issue
Block a user