pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/chat/coyim



Module Name:    pkgsrc
Committed By:   wiz
Date:           Tue May 14 22:38:58 UTC 2024

Modified Files:
        pkgsrc/chat/coyim: Makefile distinfo
Added Files:
        pkgsrc/chat/coyim/patches:
            patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go
            patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go
            patch-go.mod

Log Message:
coyim: make some progress on build on NetBSD

Dies with
# github.com/coyim/coyim
/usr/pkg/go121/pkg/tool/netbsd_amd64/link: running gcc failed: exit status 4
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabs()
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabsf()
ld: /tmp/go-link-3199807246/go.o: warning: relocation in read-only section `.gopclntab'
ld: BFD (NetBSD Binutils nb1) 2.39 assertion fail /usr/src/external/gpl3/binutils/lib/libbfd/../../dist/bfd/reloc.c:8560
/tmp/go-link-3199807246/000000.o:(.rsrc+0x100): dangerous relocation: gcc: internal compiler error: Segmentation fault signal terminated program ld
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 pkgsrc/chat/coyim/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/chat/coyim/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go \
    pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go \
    pkgsrc/chat/coyim/patches/patch-go.mod

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/chat/coyim/Makefile
diff -u pkgsrc/chat/coyim/Makefile:1.70 pkgsrc/chat/coyim/Makefile:1.71
--- pkgsrc/chat/coyim/Makefile:1.70     Sun Apr  7 07:33:38 2024
+++ pkgsrc/chat/coyim/Makefile  Tue May 14 22:38:57 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2024/04/07 07:33:38 wiz Exp $
+# $NetBSD: Makefile,v 1.71 2024/05/14 22:38:57 wiz Exp $
 
 DISTNAME=      coyim-0.4.1
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=coyim/}
@@ -14,6 +14,9 @@ LICENSE=      gnu-gpl-v3
 
 USE_TOOLS+=    pkg-config gmake
 
+# for patching
+EXTRACT_ONLY=  ${DEFAULT_DISTFILES} github.com_awnumar_memcall_@v_v0.1.2.zip
+
 GO_DIST_BASE=          ${PKGNAME_NOREV}
 GO_SRCPATH=            github.com/coyim/coyim
 GO_BUILD_PATTERN=      ${GO_SRCPATH}
@@ -23,14 +26,12 @@ MAKE_ENV+=  CGO_CFLAGS_ALLOW=".*"
 MAKE_ENV+=     CGO_CXXFLAGS_ALLOW=".*"
 MAKE_ENV+=     CGO_CPPFLAGS_ALLOW=".*"
 
-CHECK_PORTABILITY_SKIP+=       build/mac-bundle/coyim-launcher.sh
-
 COYIM_ICON=            coyim.png
 COYIM_ICON_SRC=                ${WRKSRC}/build/osx/mac-bundle/coyim.iconset/icon_32x32%2x.png@localhost
 
 INSTALLATION_DIRS+=    share/applications share/pixmaps
 
-CHECK_PORTABILITY_SKIP=        build/osx/mac-bundle/coyim-launcher.sh
+CHECK_PORTABILITY_SKIP+=       build/osx/mac-bundle/coyim-launcher.sh
 
 CHECK_RELRO_SKIP=      bin/coyim
 

Index: pkgsrc/chat/coyim/distinfo
diff -u pkgsrc/chat/coyim/distinfo:1.6 pkgsrc/chat/coyim/distinfo:1.7
--- pkgsrc/chat/coyim/distinfo:1.6      Fri Oct 20 13:59:38 2023
+++ pkgsrc/chat/coyim/distinfo  Tue May 14 22:38:57 2024
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2023/10/20 13:59:38 bsiegert Exp $
+$NetBSD: distinfo,v 1.7 2024/05/14 22:38:57 wiz Exp $
 
 BLAKE2s (coyim-0.4.1.tar.gz) = 7e8b7f2dc280756407745d68bdf76436cb2d801dafcf3222ac45af1b802cc0b7
 SHA512 (coyim-0.4.1.tar.gz) = 14243c92fb9bcbd9cc30c42a21bdeba040e84e3d069e91e482b78297f6648985a166fcbfc2967d24d485b5ac6b4747c1652b3fdb1a1a206edcaaad165862240c
@@ -285,3 +285,6 @@ Size (howett.net_plist_@v_v0.0.0-2020041
 BLAKE2s (howett.net_plist_@v_v0.0.0-20200419221736-3b63eb3a43b5.zip) = d68ee5b66378bc4d516c7105f2658d1ced52fbab4885af975a7aca20bcdd509d
 SHA512 (howett.net_plist_@v_v0.0.0-20200419221736-3b63eb3a43b5.zip) = b1f9d9cc4feef03562cbb6ec01cc55b7d02de1c3b6d68953bbd58a2c94d94f0708bf5e94389acaeba37a08354f49b46e4c548e7ca15553fa0dc8ae41cec020e0
 Size (howett.net_plist_@v_v0.0.0-20200419221736-3b63eb3a43b5.zip) = 74256 bytes
+SHA1 (patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go) = 428d993ad0860193cca0170eda45d1d0635decf1
+SHA1 (patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go) = cc42e87d15701b7853c1cbfb5cee11bf85b31393
+SHA1 (patch-go.mod) = 975b53d6eefd01eeaeba3a3fbc558a5be2611859

Added files:

Index: pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go
diff -u /dev/null pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go:1.1
--- /dev/null   Tue May 14 22:38:58 2024
+++ pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go     Tue May 14 22:38:57 2024
@@ -0,0 +1,102 @@
+$NetBSD: patch-.._github.com_awnumar_memcall@v0.1.2_memcall__netbsd.go,v 1.1 2024/05/14 22:38:57 wiz Exp $
+
+Add NetBSD support.
+https://github.com/awnumar/memcall/pull/10
+
+--- ../github.com/awnumar/memcall@v0.1.2/memcall_netbsd.go.orig        2024-05-14 22:02:31.351934223 +0000
++++ ../github.com/awnumar/memcall@v0.1.2/memcall_netbsd.go
+@@ -0,0 +1,94 @@
++//go:build netbsd
++// +build netbsd
++
++package memcall
++
++import (
++      "errors"
++      "fmt"
++
++      "golang.org/x/sys/unix"
++)
++
++// Lock is a wrapper for mlock(2), with extra precautions.
++func Lock(b []byte) error {
++      // Call mlock.
++      if err := unix.Mlock(b); err != nil {
++              return fmt.Errorf("<memcall> could not acquire lock on %p, limit reached? [Err: %s]", _getStartPtr(b), err)
++      }
++
++      return nil
++}
++
++// Unlock is a wrapper for munlock(2).
++func Unlock(b []byte) error {
++      if err := unix.Munlock(b); err != nil {
++              return fmt.Errorf("<memcall> could not free lock on %p [Err: %s]", _getStartPtr(b), err)
++      }
++
++      return nil
++}
++
++// Alloc allocates a byte slice of length n and returns it.
++func Alloc(n int) ([]byte, error) {
++      // Allocate the memory.
++      b, err := unix.Mmap(-1, 0, n, unix.PROT_READ|unix.PROT_WRITE, unix.MAP_PRIVATE|unix.MAP_ANON)
++      if err != nil {
++              return nil, fmt.Errorf("<memcall> could not allocate [Err: %s]", err)
++      }
++
++      // Wipe it just in case there is some remnant data.
++      wipe(b)
++
++      // Return the allocated memory.
++      return b, nil
++}
++
++// Free deallocates the byte slice specified.
++func Free(b []byte) error {
++      // Make the memory region readable and writable.
++      if err := Protect(b, ReadWrite()); err != nil {
++              return err
++      }
++
++      // Wipe the memory region in case of remnant data.
++      wipe(b)
++
++      // Free the memory back to the kernel.
++      if err := unix.Munmap(b); err != nil {
++              return fmt.Errorf("<memcall> could not deallocate %p [Err: %s]", _getStartPtr(b), err)
++      }
++
++      return nil
++}
++
++// Protect modifies the protection state for a specified byte slice.
++func Protect(b []byte, mpf MemoryProtectionFlag) error {
++      var prot int
++      if mpf.flag == ReadWrite().flag {
++              prot = unix.PROT_READ | unix.PROT_WRITE
++      } else if mpf.flag == ReadOnly().flag {
++              prot = unix.PROT_READ
++      } else if mpf.flag == NoAccess().flag {
++              prot = unix.PROT_NONE
++      } else {
++              return errors.New(ErrInvalidFlag)
++      }
++
++      // Change the protection value of the byte slice.
++      if err := unix.Mprotect(b, prot); err != nil {
++              return fmt.Errorf("<memcall> could not set %d on %p [Err: %s]", prot, _getStartPtr(b), err)
++      }
++
++      return nil
++}
++
++// DisableCoreDumps disables core dumps on Unix systems.
++func DisableCoreDumps() error {
++      // Disable core dumps.
++      if err := unix.Setrlimit(unix.RLIMIT_CORE, &unix.Rlimit{Cur: 0, Max: 0}); err != nil {
++              return fmt.Errorf("<memcall> could not set rlimit [Err: %s]", err)
++      }
++
++      return nil
++}
Index: pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go
diff -u /dev/null pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go:1.1
--- /dev/null   Tue May 14 22:38:58 2024
+++ pkgsrc/chat/coyim/patches/patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go       Tue May 14 22:38:57 2024
@@ -0,0 +1,13 @@
+$NetBSD: patch-.._github.com_awnumar_memcall@v0.1.2_memcall__unix.go,v 1.1 2024/05/14 22:38:57 wiz Exp $
+
+Add NetBSD support.
+https://github.com/awnumar/memcall/pull/10
+
+--- ../github.com/awnumar/memcall@v0.1.2/memcall_unix.go.orig  1979-11-29 23:00:00.000000000 +0000
++++ ../github.com/awnumar/memcall@v0.1.2/memcall_unix.go
+@@ -1,4 +1,4 @@
+-// +build !windows,!darwin,!openbsd,!freebsd
++// +build !windows,!darwin,!openbsd,!freebsd,!netbsd
+ 
+ package memcall
+ 
Index: pkgsrc/chat/coyim/patches/patch-go.mod
diff -u /dev/null pkgsrc/chat/coyim/patches/patch-go.mod:1.1
--- /dev/null   Tue May 14 22:38:58 2024
+++ pkgsrc/chat/coyim/patches/patch-go.mod      Tue May 14 22:38:57 2024
@@ -0,0 +1,12 @@
+$NetBSD: patch-go.mod,v 1.1 2024/05/14 22:38:57 wiz Exp $
+
+Use patched copy that supports NetBSD.
+
+--- go.mod.orig        2024-05-14 22:00:14.425839316 +0000
++++ go.mod
+@@ -39,3 +39,5 @@ require (
+       golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect
+       gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
+ )
++
++replace github.com/awnumar/memcall => ../github.com/awnumar/memcall@v0.1.2



Home | Main Index | Thread Index | Old Index