Compare commits
4 Commits
ba7d7037ac
...
892e0d1c81
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
892e0d1c81 | ||
|
|
8840bab14b | ||
|
|
dc4e15353f | ||
|
|
cec480a492 |
@@ -1,31 +0,0 @@
|
|||||||
From 8a370430c7d855a63d15337e9781933f6e55707f Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrey Semenov <semenov.ao@greendatasoft.ru>
|
|
||||||
Date: Thu, 19 Sep 2024 17:32:37 +0500
|
|
||||||
Subject: [PATCH] fix: write to lConn even if any error met and some bytes was
|
|
||||||
read
|
|
||||||
|
|
||||||
---
|
|
||||||
proxy/handler/https.go | 3 +--
|
|
||||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/proxy/handler/https.go b/proxy/handler/https.go
|
|
||||||
index f709925..bc320fd 100644
|
|
||||||
--- a/proxy/handler/https.go
|
|
||||||
+++ b/proxy/handler/https.go
|
|
||||||
@@ -2,7 +2,6 @@ package handler
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
- "errors"
|
|
||||||
"io"
|
|
||||||
"net"
|
|
||||||
"regexp"
|
|
||||||
@@ -134,7 +133,7 @@ func (h *HttpsHandler) communicate(ctx context.Context, from *net.TCPConn, to *n
|
|
||||||
|
|
||||||
bytesRead, err := ReadBytes(ctx, from, buf)
|
|
||||||
if err != nil {
|
|
||||||
- if errors.Is(err, io.EOF) && len(bytesRead) > 0 {
|
|
||||||
+ if len(bytesRead) > 0 {
|
|
||||||
h.write(logger, td, to, bytesRead)
|
|
||||||
}
|
|
||||||
logger.Debug().Msgf("error reading from %s: %s", fd, err)
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
Axel accelerates the HTTP/FTP downloading process by using multiple
|
|
||||||
connections for one file. It can use multiple mirrors for a download.
|
|
||||||
Axel has no dependencies and is lightweight, so it might be useful as a
|
|
||||||
wget clone on byte-critical systems. Axel is the perfect utility for
|
|
||||||
those connections to wherever you are downloading from that may have a
|
|
||||||
limit on ftp stream speeds, http sessions that burst and slow down, or
|
|
||||||
servers with a slow connection.
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Slackware build script for SpoofDPI
|
|
||||||
|
|
||||||
# Copyright 2024 Sergei Fedosoff <eleksir@gmail.com>
|
|
||||||
#
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use of this script, with or without modification, is
|
|
||||||
# permitted provided that the following conditions are met:
|
|
||||||
#
|
|
||||||
# 1. Redistributions of this script must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
|
|
||||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
cd $(dirname $0) ; CWD=$(pwd)
|
|
||||||
|
|
||||||
PRGNAM=SpoofDPI
|
|
||||||
VERSION=${VERSION:-0.12.0}
|
|
||||||
BUILD=${BUILD:-2}
|
|
||||||
TAG=${TAG:-_EXs}
|
|
||||||
PKGTYPE=${PKGTYPE:-tgz}
|
|
||||||
|
|
||||||
if [ -z "$ARCH" ]; then
|
|
||||||
case "$( uname -m )" in
|
|
||||||
i?86) ARCH=i586 ;;
|
|
||||||
arm*) ARCH=arm ;;
|
|
||||||
*) ARCH=$( uname -m ) ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
||||||
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
TMP=${TMP:-/tmp/EXs}
|
|
||||||
PKG=$TMP/package-$PRGNAM
|
|
||||||
OUTPUT=${OUTPUT:-/tmp}
|
|
||||||
|
|
||||||
if [ "$ARCH" = "i586" ]; then
|
|
||||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
|
||||||
LIBDIRSUFFIX=""
|
|
||||||
elif [ "$ARCH" = "i686" ]; then
|
|
||||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
||||||
LIBDIRSUFFIX=""
|
|
||||||
elif [ "$ARCH" = "x86_64" ]; then
|
|
||||||
SLKCFLAGS="-O2 -fPIC"
|
|
||||||
LIBDIRSUFFIX="64"
|
|
||||||
else
|
|
||||||
SLKCFLAGS="-O2"
|
|
||||||
LIBDIRSUFFIX=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
rm -rf $PKG
|
|
||||||
mkdir -p $TMP $PKG $OUTPUT
|
|
||||||
cd $TMP
|
|
||||||
rm -rf $PRGNAM-$VERSION
|
|
||||||
tar xf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
||||||
cd $PRGNAM-$VERSION
|
|
||||||
chown -R root:root .
|
|
||||||
find -L . \
|
|
||||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
||||||
-exec chmod 755 {} \+ -o \
|
|
||||||
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
||||||
-exec chmod 644 {} \+
|
|
||||||
|
|
||||||
patch -p1 -i $CWD/a12a13eb4b347899b18cf8df57cc423e55313e2a.patch
|
|
||||||
patch -p1 -i $CWD/8a370430c7d855a63d15337e9781933f6e55707f.patch
|
|
||||||
|
|
||||||
CGO_ENABLED=0 go build -ldflags '-w -s -extldflags "-static"' -trimpath -tags timetzdata -o spoofdpi ./cmd/spoofdpi
|
|
||||||
|
|
||||||
install -Dpm 0755 spoofdpi $PKG/usr/sbin/spoofdpi
|
|
||||||
install -Dpm 0644 $CWD/rc.spoofdpi $PKG/etc/rc.d/rc.spoofdpi.new
|
|
||||||
install -Dpm 0644 $CWD/spoofdpi.sysconfig $PKG/etc/default/spoofdpi.new
|
|
||||||
install -Ddm 0755 $PKG/usr/doc/$PRGNAM-$VERSION
|
|
||||||
install -Dpm 0644 LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
|
|
||||||
install -Dpm 0644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
||||||
install -Dpm 0644 $CWD/slack-desc $PKG/install/slack-desc
|
|
||||||
install -Dpm 0644 $CWD/doinst.sh $PKG/install/doinst.sh
|
|
||||||
|
|
||||||
cd $PKG
|
|
||||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
PRGNAM="SpoofDPI"
|
|
||||||
VERSION="0.12.0"
|
|
||||||
HOMEPAGE="https://github.com/xvzc/SpoofDPI"
|
|
||||||
DOWNLOAD="https://github.com/xvzc/SpoofDPI/archive/refs/tags/v0.12.0/SpoofDPI-0.12.0.tar.gz"
|
|
||||||
MD5SUM="d43ae5a52c3adf6825bc94775ee88f7f"
|
|
||||||
DOWNLOAD_x86_64=""
|
|
||||||
MD5SUM_x86_64=""
|
|
||||||
REQUIRES=""
|
|
||||||
BUILDREQUIRES="google-go-lang"
|
|
||||||
MAINTAINER="Sergei Fedosoff"
|
|
||||||
EMAIL="eleksir@gmail.com"
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
From a12a13eb4b347899b18cf8df57cc423e55313e2a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Andrey Semenov <semenov.ao@greendatasoft.ru>
|
|
||||||
Date: Thu, 19 Sep 2024 17:21:03 +0500
|
|
||||||
Subject: [PATCH] fix: write to lConn even if io.EOF met and some bytes was
|
|
||||||
read
|
|
||||||
|
|
||||||
---
|
|
||||||
proxy/handler/https.go | 58 ++++++++++++++++++++++++++++++++----------
|
|
||||||
1 file changed, 45 insertions(+), 13 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/proxy/handler/https.go b/proxy/handler/https.go
|
|
||||||
index 857fead..f709925 100644
|
|
||||||
--- a/proxy/handler/https.go
|
|
||||||
+++ b/proxy/handler/https.go
|
|
||||||
@@ -2,10 +2,14 @@ package handler
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
+ "errors"
|
|
||||||
+ "io"
|
|
||||||
"net"
|
|
||||||
"regexp"
|
|
||||||
"strconv"
|
|
||||||
+ "sync"
|
|
||||||
|
|
||||||
+ "github.com/rs/zerolog"
|
|
||||||
"github.com/xvzc/SpoofDPI/packet"
|
|
||||||
"github.com/xvzc/SpoofDPI/util"
|
|
||||||
"github.com/xvzc/SpoofDPI/util/log"
|
|
||||||
@@ -74,36 +78,53 @@ func (h *HttpsHandler) Serve(ctx context.Context, lConn *net.TCPConn, initPkt *p
|
|
||||||
logger.Debug().Msgf("client sent hello %d bytes", len(clientHello))
|
|
||||||
|
|
||||||
// Generate a go routine that reads from the server
|
|
||||||
- go h.communicate(ctx, rConn, lConn, initPkt.Domain(), lConn.RemoteAddr().String())
|
|
||||||
- go h.communicate(ctx, lConn, rConn, lConn.RemoteAddr().String(), initPkt.Domain())
|
|
||||||
+ closeWg := sync.WaitGroup{}
|
|
||||||
+ closeWg.Add(2)
|
|
||||||
+ done := make(chan struct{})
|
|
||||||
+ doneOnce := sync.Once{}
|
|
||||||
+ closeDoneFunc := func() {
|
|
||||||
+ close(done)
|
|
||||||
+ }
|
|
||||||
+ go func() {
|
|
||||||
+ defer closeWg.Done()
|
|
||||||
+ h.communicate(ctx, rConn, lConn, initPkt.Domain(), lConn.RemoteAddr().String())
|
|
||||||
+ }()
|
|
||||||
+ go func() {
|
|
||||||
+ defer closeWg.Done()
|
|
||||||
+ h.communicate(ctx, lConn, rConn, lConn.RemoteAddr().String(), initPkt.Domain())
|
|
||||||
+ }()
|
|
||||||
+ go func(wg *sync.WaitGroup) {
|
|
||||||
+ wg.Wait()
|
|
||||||
+ doneOnce.Do(closeDoneFunc)
|
|
||||||
+ }(&closeWg)
|
|
||||||
|
|
||||||
if h.exploit {
|
|
||||||
logger.Debug().Msgf("writing chunked client hello to %s", initPkt.Domain())
|
|
||||||
chunks := splitInChunks(ctx, clientHello, h.windowsize)
|
|
||||||
if _, err := writeChunks(rConn, chunks); err != nil {
|
|
||||||
logger.Debug().Msgf("error writing chunked client hello to %s: %s", initPkt.Domain(), err)
|
|
||||||
- return
|
|
||||||
+ doneOnce.Do(closeDoneFunc)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
logger.Debug().Msgf("writing plain client hello to %s", initPkt.Domain())
|
|
||||||
if _, err := rConn.Write(clientHello); err != nil {
|
|
||||||
logger.Debug().Msgf("error writing plain client hello to %s: %s", initPkt.Domain(), err)
|
|
||||||
- return
|
|
||||||
+ doneOnce.Do(closeDoneFunc)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ // wait while conn handling routines stop, then close both connections
|
|
||||||
+ // current routine will sleep until conn handling routines works
|
|
||||||
+ <-done
|
|
||||||
+ _ = lConn.Close()
|
|
||||||
+ _ = rConn.Close()
|
|
||||||
+
|
|
||||||
+ logger.Debug().Msgf("closing proxy connection: %s -> %s", lConn.RemoteAddr(), initPkt.Domain())
|
|
||||||
}
|
|
||||||
|
|
||||||
func (h *HttpsHandler) communicate(ctx context.Context, from *net.TCPConn, to *net.TCPConn, fd string, td string) {
|
|
||||||
ctx = util.GetCtxWithScope(ctx, h.protocol)
|
|
||||||
logger := log.GetCtxLogger(ctx)
|
|
||||||
|
|
||||||
- defer func() {
|
|
||||||
- from.Close()
|
|
||||||
- to.Close()
|
|
||||||
-
|
|
||||||
- logger.Debug().Msgf("closing proxy connection: %s -> %s", fd, td)
|
|
||||||
- }()
|
|
||||||
-
|
|
||||||
buf := make([]byte, h.bufferSize)
|
|
||||||
for {
|
|
||||||
err := setConnectionTimeout(from, h.timeout)
|
|
||||||
@@ -113,17 +134,28 @@ func (h *HttpsHandler) communicate(ctx context.Context, from *net.TCPConn, to *n
|
|
||||||
|
|
||||||
bytesRead, err := ReadBytes(ctx, from, buf)
|
|
||||||
if err != nil {
|
|
||||||
+ if errors.Is(err, io.EOF) && len(bytesRead) > 0 {
|
|
||||||
+ h.write(logger, td, to, bytesRead)
|
|
||||||
+ }
|
|
||||||
logger.Debug().Msgf("error reading from %s: %s", fd, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
- if _, err := to.Write(bytesRead); err != nil {
|
|
||||||
- logger.Debug().Msgf("error writing to %s", td)
|
|
||||||
+ if !h.write(logger, td, to, bytesRead) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+func (h *HttpsHandler) write(logger zerolog.Logger, connName string, to io.Writer, bytes []byte) (ok bool) {
|
|
||||||
+ ok = true
|
|
||||||
+ if _, err := to.Write(bytes); err != nil {
|
|
||||||
+ logger.Debug().Msgf("error writing to %s", connName)
|
|
||||||
+ ok = false
|
|
||||||
+ }
|
|
||||||
+ return
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
func splitInChunks(ctx context.Context, bytes []byte, size int) [][]byte {
|
|
||||||
logger := log.GetCtxLogger(ctx)
|
|
||||||
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
config() {
|
|
||||||
NEW="$1"
|
|
||||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
||||||
# If there's no config file by that name, mv it over:
|
|
||||||
if [ ! -r $OLD ]; then
|
|
||||||
mv $NEW $OLD
|
|
||||||
elif [ "$(cat $OLD|md5sum)" = "$(cat $NEW|md5sum)" ]; then
|
|
||||||
# toss the redundant copy
|
|
||||||
rm $NEW
|
|
||||||
fi
|
|
||||||
# Otherwise, we leave the .new copy for the admin to consider...
|
|
||||||
}
|
|
||||||
|
|
||||||
preserve_perms() {
|
|
||||||
NEW="$1"
|
|
||||||
OLD="$(dirname $NEW)/$(basename $NEW .new)"
|
|
||||||
if [ -e $OLD ]; then
|
|
||||||
cp -a $OLD ${NEW}.incoming
|
|
||||||
cat $NEW > ${NEW}.incoming
|
|
||||||
mv ${NEW}.incoming $NEW
|
|
||||||
fi
|
|
||||||
config $NEW
|
|
||||||
}
|
|
||||||
|
|
||||||
config etc/default/spoofdpi.new
|
|
||||||
preserve_perms etc/rc.d/rc.spoofdpi.new
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Copyright 2024 Sergei Fedosoff <eleksir@gmail.com>
|
|
||||||
#
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions are
|
|
||||||
# met:
|
|
||||||
#
|
|
||||||
# * Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
||||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
||||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
||||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
||||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
|
||||||
source /etc/defaults/spoofdpi
|
|
||||||
PIDFILE="/run/spoofdpi.pid"
|
|
||||||
|
|
||||||
_start() {
|
|
||||||
# make sure bitlbee isn't running yet
|
|
||||||
if [ ! -f $PIDFILE ]; then
|
|
||||||
/usr/sbin/daemonize -p $PIDFILE -- /usr/sbin/spoofdpi $OPTIONS
|
|
||||||
else
|
|
||||||
echo "spoofdpi is already active and running under PID: $(cat $PIDFILE)"
|
|
||||||
echo "if you think this is wrong, remove the offending PID file"
|
|
||||||
echo "and restart spoof"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_stop() {
|
|
||||||
echo -n "Stopping spoofdpi..."
|
|
||||||
|
|
||||||
if [ -r $PIDFILE ]; then
|
|
||||||
kill $(cat $PIDFILE)
|
|
||||||
|
|
||||||
for i in 1 2 3; do
|
|
||||||
if [ -f $PIDFILE ]; then
|
|
||||||
sleep 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -r $PIDFILE ]; then
|
|
||||||
kill -9 $(cat $PIDFILE) 2>/dev/null
|
|
||||||
rm $PIDFILE
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "done"
|
|
||||||
else
|
|
||||||
echo "Unable to find $PIDFILE and stop spoofdpi"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Let's see how we are being called.
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
_start
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
_stop
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
_stop
|
|
||||||
sleep 3
|
|
||||||
_start
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $(basename $0) {start|stop|restart}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# HOW TO EDIT THIS FILE:
|
|
||||||
# The "handy ruler" below makes it easier to edit a package description.
|
|
||||||
# Line up the first '|' above the ':' following the base package name, and
|
|
||||||
# the '|' on the right side marks the last column you can put a character in.
|
|
||||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
|
||||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
|
||||||
|
|
||||||
|-----handy-ruler------------------------------------------------------|
|
|
||||||
SpoofDPI: SpoofDPI
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI: A simple and fast software designed to bypass Deep Packet Inspection.
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI: Homepage: https://github.com/xvzc/SpoofDPI
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI:
|
|
||||||
SpoofDPI:
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
# Options for running SpoofDPI daemon
|
|
||||||
OPTIONS="-addr 127.0.0.1 -port 8080 -no-banner -system-proxy false"
|
|
||||||
25
i3/2746e0319b03a8a5a02b57a69b1fb47e0a9c22f1.patch
Normal file
25
i3/2746e0319b03a8a5a02b57a69b1fb47e0a9c22f1.patch
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
From 2746e0319b03a8a5a02b57a69b1fb47e0a9c22f1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Stapelberg <michael@stapelberg.de>
|
||||||
|
Date: Wed, 6 Nov 2024 19:17:37 +0100
|
||||||
|
Subject: [PATCH] i3bar: work around weird clang compiler behavior
|
||||||
|
|
||||||
|
clang used to not warn (= error, with -Werror) about this line. Oh well.
|
||||||
|
---
|
||||||
|
i3bar/src/xcb.c | 4 +++-
|
||||||
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
|
||||||
|
index 4211123d44..f975826abf 100644
|
||||||
|
--- a/i3bar/src/xcb.c
|
||||||
|
+++ b/i3bar/src/xcb.c
|
||||||
|
@@ -1515,7 +1515,9 @@ static void send_tray_clientmessage(void) {
|
||||||
|
static void init_tray(void) {
|
||||||
|
DLOG("Initializing system tray functionality\n");
|
||||||
|
/* request the tray manager atom for the X11 display we are running on */
|
||||||
|
- char atomname[strlen("_NET_SYSTEM_TRAY_S") + 11];
|
||||||
|
+ /* The following line cannot use strlen as that makes compilation fail with
|
||||||
|
+ * some versions of clang (-Wgnu-folding-constant): */
|
||||||
|
+ char atomname[18 /* strlen("_NET_SYSTEM_TRAY_S") */ + 11];
|
||||||
|
snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S%d", screen);
|
||||||
|
xcb_intern_atom_cookie_t tray_cookie;
|
||||||
|
if (tray_reply == NULL) {
|
||||||
30
i3/853b0d9161a5f99c8491751590229a449e4076b6.patch
Normal file
30
i3/853b0d9161a5f99c8491751590229a449e4076b6.patch
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
From 853b0d9161a5f99c8491751590229a449e4076b6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Michael Stapelberg <stapelberg@users.noreply.github.com>
|
||||||
|
Date: Mon, 30 Dec 2024 08:29:29 +0100
|
||||||
|
Subject: [PATCH] i3bar: fix clang compilation error by using const size_t
|
||||||
|
(#6349)
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Thanks to Shouη (@Shoun2137 on GitHub) for the suggestion.
|
||||||
|
---
|
||||||
|
i3bar/src/xcb.c | 5 +++--
|
||||||
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
|
||||||
|
index f975826abf..146db172e3 100644
|
||||||
|
--- a/i3bar/src/xcb.c
|
||||||
|
+++ b/i3bar/src/xcb.c
|
||||||
|
@@ -1517,8 +1517,9 @@ static void init_tray(void) {
|
||||||
|
/* request the tray manager atom for the X11 display we are running on */
|
||||||
|
/* The following line cannot use strlen as that makes compilation fail with
|
||||||
|
* some versions of clang (-Wgnu-folding-constant): */
|
||||||
|
- char atomname[18 /* strlen("_NET_SYSTEM_TRAY_S") */ + 11];
|
||||||
|
- snprintf(atomname, strlen("_NET_SYSTEM_TRAY_S") + 11, "_NET_SYSTEM_TRAY_S%d", screen);
|
||||||
|
+ const size_t systray_len = strlen("_NET_SYSTEM_TRAY_S") + 11;
|
||||||
|
+ char atomname[systray_len];
|
||||||
|
+ snprintf(atomname, systray_len, "_NET_SYSTEM_TRAY_S%d", screen);
|
||||||
|
xcb_intern_atom_cookie_t tray_cookie;
|
||||||
|
if (tray_reply == NULL) {
|
||||||
|
tray_cookie = xcb_intern_atom(xcb_connection, 0, strlen(atomname), atomname);
|
||||||
311
i3/cfa4cf16bea809c7c715a86c428757e577c85254.patch
Normal file
311
i3/cfa4cf16bea809c7c715a86c428757e577c85254.patch
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
From cfa4cf16bea809c7c715a86c428757e577c85254 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Sergey Vlasov <sigprof@gmail.com>
|
||||||
|
Date: Tue, 22 Apr 2025 00:26:17 +0300
|
||||||
|
Subject: [PATCH] Set `_NET_FRAME_EXTENTS` according to the actual decoration
|
||||||
|
size (#5944)
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Inspired by #5384, but instead of just using the border width, this PR
|
||||||
|
reports the actual frame extents for the window, which may also include
|
||||||
|
the title bar (for floating windows and tiled windows in plain split
|
||||||
|
containers, but not for tiled windows in stacked/tabbed containers).
|
||||||
|
|
||||||
|
The existing `con_border_style_rect()` function should already handle
|
||||||
|
all configuration options which can affect the decoration sizes (if it
|
||||||
|
does not, that would also show up in other places); its result just
|
||||||
|
needs to be converted into the format used by the `_NET_FRAME_EXTENTS`
|
||||||
|
property.
|
||||||
|
|
||||||
|
This PR fixes #4292 probably in the best way possible (the reported
|
||||||
|
`_NET_FRAME_EXTENTS` values should always match the actual sizes of
|
||||||
|
window frame elements which are actually drawn into the X11 frame window
|
||||||
|
into which the client window is reparented). The only really problematic
|
||||||
|
case is with the stacked/tabbed containers, for which the title bar is
|
||||||
|
actually drawn into a completely separate window, therefore the title
|
||||||
|
bar size cannot be reported in `_NET_FRAME_EXTENTS` (actually I tried to
|
||||||
|
calculate the size of those decorations and add it to the top decoration
|
||||||
|
size, but that did not change the behavior of `picom`).
|
||||||
|
|
||||||
|
<details><summary>Large screenshots here (3840×2160)</summary>
|
||||||
|
|
||||||
|
Example of configuration with `hide_edge_borders smart` — a single
|
||||||
|
window does not have borders, so only the top frame size is non-zero:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
but multiple windows have borders:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Changing border width works too (although with `border normal 8` you can
|
||||||
|
see that the top border overlaps the title text, because on the i3 side
|
||||||
|
that border does not really exists, and `picom` just draws it over; also
|
||||||
|
the pixel sizes reported by `xprop` and `xwininfo` are not identical to
|
||||||
|
what is specified in i3, because I use 168 dpi on this system, therefore
|
||||||
|
4 px in the i3 config = 7 dpx):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Handling of tabbed containers is less perfect though. Here is a single
|
||||||
|
tabbed container with `hide_edge_borders smart`, so it does not really
|
||||||
|
have a border — note that all frame extents are zero, and the titlebar
|
||||||
|
is rounded separately (although it could easily be excluded from
|
||||||
|
rounding, that does not really help much):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Once the border actually appears, you may notice that the top part of
|
||||||
|
the `picom` border actually gets drawn over the top part of the window,
|
||||||
|
partially obscuring the top line in this terminal (`picom` does not mind
|
||||||
|
that the top frame size is reported as 0):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Some examples of floating windows (no major problems there):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Options like `hide_edge_borders both` work too when gaps are removed
|
||||||
|
(although the resulting behavior with `picom` is probably not very
|
||||||
|
useful — the rounded border gets drawn only if all of the left, bottom
|
||||||
|
and right borders are present):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The same with `border pixel 8` (note that windows with only the top
|
||||||
|
border hidden still get the rounded border treatment by `picom`, but the
|
||||||
|
border overlaps the top part of the window):
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---------
|
||||||
|
|
||||||
|
Signed-off-by: Sergey Vlasov <sigprof@gmail.com>
|
||||||
|
Co-authored-by: Orestis Floros <orestisflo@gmail.com>
|
||||||
|
---
|
||||||
|
.../changes/5-set-_NET_FRAME_EXTENTS | 1 +
|
||||||
|
src/x.c | 18 ++
|
||||||
|
testcases/t/323-net-frame-extents.t | 173 ++++++++++++++++++
|
||||||
|
3 files changed, 192 insertions(+)
|
||||||
|
create mode 100644 release-notes/changes/5-set-_NET_FRAME_EXTENTS
|
||||||
|
create mode 100644 testcases/t/323-net-frame-extents.t
|
||||||
|
|
||||||
|
diff --git a/release-notes/changes/5-set-_NET_FRAME_EXTENTS b/release-notes/changes/5-set-_NET_FRAME_EXTENTS
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..0d40253a75
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/release-notes/changes/5-set-_NET_FRAME_EXTENTS
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+Set _NET_FRAME_EXTENTS according to the actual decoration size
|
||||||
|
diff --git a/src/x.c b/src/x.c
|
||||||
|
index e28c3d03b2..499c6e2330 100644
|
||||||
|
--- a/src/x.c
|
||||||
|
+++ b/src/x.c
|
||||||
|
@@ -1126,6 +1126,24 @@ void x_push_node(Con *con) {
|
||||||
|
|
||||||
|
set_shape_state(con, need_reshape);
|
||||||
|
|
||||||
|
+ /* Set _NET_FRAME_EXTENTS according to the actual decoration size. */
|
||||||
|
+ if (con != NULL && con->window != NULL) {
|
||||||
|
+ Rect bsr = con_border_style_rect(con);
|
||||||
|
+ Rect r = {
|
||||||
|
+ bsr.x, /* left */
|
||||||
|
+ 0 - bsr.width - bsr.x, /* right */
|
||||||
|
+ bsr.y, /* top */
|
||||||
|
+ 0 - bsr.height - bsr.y /* bottom */
|
||||||
|
+ };
|
||||||
|
+ xcb_change_property(
|
||||||
|
+ conn,
|
||||||
|
+ XCB_PROP_MODE_REPLACE,
|
||||||
|
+ con->window->id,
|
||||||
|
+ A__NET_FRAME_EXTENTS,
|
||||||
|
+ XCB_ATOM_CARDINAL, 32, 4,
|
||||||
|
+ &r);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* Map if map state changed, also ensure that the child window
|
||||||
|
* is changed if we are mapped and there is a new, unmapped child window.
|
||||||
|
* Unmaps are handled in x_push_node_unmaps(). */
|
||||||
|
diff --git a/testcases/t/323-net-frame-extents.t b/testcases/t/323-net-frame-extents.t
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000000..7098f21d5f
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/testcases/t/323-net-frame-extents.t
|
||||||
|
@@ -0,0 +1,173 @@
|
||||||
|
+#!perl
|
||||||
|
+# vim:ts=4:sw=4:expandtab
|
||||||
|
+#
|
||||||
|
+# Please read the following documents before working on tests:
|
||||||
|
+# • https://build.i3wm.org/docs/testsuite.html
|
||||||
|
+# (or docs/testsuite)
|
||||||
|
+#
|
||||||
|
+# • https://build.i3wm.org/docs/lib-i3test.html
|
||||||
|
+# (alternatively: perldoc ./testcases/lib/i3test.pm)
|
||||||
|
+#
|
||||||
|
+# • https://build.i3wm.org/docs/ipc.html
|
||||||
|
+# (or docs/ipc)
|
||||||
|
+#
|
||||||
|
+# • https://i3wm.org/downloads/modern_perl_a4.pdf
|
||||||
|
+# (unless you are already familiar with Perl)
|
||||||
|
+#
|
||||||
|
+# Verify _NET_FRAME_EXTENTS is set correctly
|
||||||
|
+# Ticket: #4292
|
||||||
|
+# Bug still in: 4.24-8-g44b67d11
|
||||||
|
+use i3test i3_autostart => 0;
|
||||||
|
+use X11::XCB qw(:all);
|
||||||
|
+
|
||||||
|
+my $pid = launch_with_config('-default');
|
||||||
|
+
|
||||||
|
+sub net_frame_extents {
|
||||||
|
+ my ($window) = @_;
|
||||||
|
+
|
||||||
|
+ my $cookie = $x->get_property(
|
||||||
|
+ 0,
|
||||||
|
+ $window->{id},
|
||||||
|
+ $x->atom(name => '_NET_FRAME_EXTENTS')->id,
|
||||||
|
+ GET_PROPERTY_TYPE_ANY,
|
||||||
|
+ 0,
|
||||||
|
+ 4
|
||||||
|
+ );
|
||||||
|
+
|
||||||
|
+ my $reply = $x->get_property_reply($cookie->{sequence});
|
||||||
|
+ my $len = $reply->{length};
|
||||||
|
+ return [] if $len == 0;
|
||||||
|
+
|
||||||
|
+ return unpack("L$len", $reply->{value});
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+sub is_net_frame_extents {
|
||||||
|
+ my ($window, $expect, $msg) = @_;
|
||||||
|
+ $msg //= "";
|
||||||
|
+ $msg = "frame extents $msg";
|
||||||
|
+ $msg =~ s/\s+$//;
|
||||||
|
+ my @extents = net_frame_extents($window);
|
||||||
|
+ is_deeply(\@extents, $expect, "$msg: got: @extents want: @$expect");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+subtest 'basic border styles' => sub {
|
||||||
|
+ my $w = open_window;
|
||||||
|
+ cmd 'border normal 3';
|
||||||
|
+ is_net_frame_extents($w, [3, 3, 18, 3], "normal border with 3px width");
|
||||||
|
+
|
||||||
|
+ cmd 'border pixel 1';
|
||||||
|
+ is_net_frame_extents($w, [1, 1, 1, 1], "pixel border with 1px width");
|
||||||
|
+
|
||||||
|
+ cmd 'border pixel 5';
|
||||||
|
+ is_net_frame_extents($w, [5, 5, 5, 5], "pixel border with 5px width");
|
||||||
|
+
|
||||||
|
+ open_window;
|
||||||
|
+ is_net_frame_extents($w, [5, 5, 5, 5], "other window does not affect");
|
||||||
|
+ cmd 'kill';
|
||||||
|
+
|
||||||
|
+ cmd 'border normal 0';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 18, 0], "normal border with 0px width");
|
||||||
|
+
|
||||||
|
+ cmd 'border none';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 0, 0], "no border");
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+subtest 'multiple windows in different layouts' => sub {
|
||||||
|
+ fresh_workspace;
|
||||||
|
+
|
||||||
|
+ my $w1 = open_window;
|
||||||
|
+ my $w2 = open_window;
|
||||||
|
+ my $w3 = open_window;
|
||||||
|
+
|
||||||
|
+ cmd 'border normal 2';
|
||||||
|
+ is_net_frame_extents($w1, [2, 2, 18, 2], "window 1 in splith layout with normal border");
|
||||||
|
+ is_net_frame_extents($w2, [2, 2, 18, 2], "window 2 in splith layout with normal border");
|
||||||
|
+ is_net_frame_extents($w3, [2, 2, 18, 2], "window 3 in splith layout with normal border");
|
||||||
|
+
|
||||||
|
+ cmd 'layout stacking';
|
||||||
|
+ is_net_frame_extents($w1, [2, 2, 0, 2], "window 1 in stacking layout");
|
||||||
|
+ is_net_frame_extents($w2, [2, 2, 0, 2], "window 2 in stacking layout");
|
||||||
|
+ is_net_frame_extents($w3, [2, 2, 0, 2], "window 3 in stacking layout");
|
||||||
|
+
|
||||||
|
+ cmd 'layout tabbed';
|
||||||
|
+ is_net_frame_extents($w1, [2, 2, 0, 2], "window 1 in tabbed layout");
|
||||||
|
+ is_net_frame_extents($w2, [2, 2, 0, 2], "window 2 in tabbed layout");
|
||||||
|
+ is_net_frame_extents($w3, [2, 2, 0, 2], "window 3 in tabbed layout");
|
||||||
|
+
|
||||||
|
+ cmd 'layout splitv';
|
||||||
|
+ is_net_frame_extents($w1, [2, 2, 18, 2], "window 1 in splitv layout");
|
||||||
|
+ is_net_frame_extents($w2, [2, 2, 18, 2], "window 2 in splitv layout");
|
||||||
|
+ is_net_frame_extents($w3, [2, 2, 18, 2], "window 3 in splitv layout");
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+sub launch_with_hide_edge_borders {
|
||||||
|
+ my ($value) = @_;
|
||||||
|
+ my $config = <<EOT;
|
||||||
|
+# i3 config file (v4)
|
||||||
|
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
|
||||||
|
+hide_edge_borders $value
|
||||||
|
+EOT
|
||||||
|
+
|
||||||
|
+ kill_all_windows;
|
||||||
|
+ exit_gracefully($pid);
|
||||||
|
+ $pid = launch_with_config($config);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+subtest 'hide_edge_borders' => sub {
|
||||||
|
+ launch_with_hide_edge_borders('none');
|
||||||
|
+ my $w = open_window;
|
||||||
|
+ cmd 'border normal 3';
|
||||||
|
+ is_net_frame_extents($w, [3, 3, 18, 3], "window with normal borders (hide_edge_borders none)");
|
||||||
|
+
|
||||||
|
+ launch_with_hide_edge_borders('vertical');
|
||||||
|
+ $w = open_window;
|
||||||
|
+ cmd 'border normal 3';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 18, 3], "window with hidden vertical borders");
|
||||||
|
+
|
||||||
|
+ launch_with_hide_edge_borders('horizontal');
|
||||||
|
+ $w = open_window;
|
||||||
|
+ cmd 'border normal 3';
|
||||||
|
+ is_net_frame_extents($w, [3, 3, 18, 0], "window with hidden horizontal borders");
|
||||||
|
+ cmd 'border pixel 3';
|
||||||
|
+ is_net_frame_extents($w, [3, 3, 0, 0], "window with hidden horizontal borders");
|
||||||
|
+
|
||||||
|
+ launch_with_hide_edge_borders('both');
|
||||||
|
+ $w = open_window;
|
||||||
|
+ cmd 'border normal 3';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 18, 0], "window with all edge borders hidden");
|
||||||
|
+ cmd 'border pixel 3';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 0, 0], "window with all edge borders hidden");
|
||||||
|
+
|
||||||
|
+ launch_with_hide_edge_borders('smart');
|
||||||
|
+ $w = open_window;
|
||||||
|
+ cmd 'border normal 3';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 18, 0], "window with smart borders (single window)");
|
||||||
|
+ cmd 'border pixel 3';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 0, 0], "window with smart borders (single window)");
|
||||||
|
+
|
||||||
|
+ my $w2 = open_window;
|
||||||
|
+ cmd 'border normal 5';
|
||||||
|
+ is_net_frame_extents($w, [3, 3, 3, 3], "first window with smart borders (multiple windows)");
|
||||||
|
+ is_net_frame_extents($w2, [5, 5, 18, 5], "second window with smart borders (multiple windows)");
|
||||||
|
+
|
||||||
|
+ exit_gracefully($pid);
|
||||||
|
+ launch_with_config('-default');
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+subtest 'floating windows' => sub {
|
||||||
|
+ fresh_workspace;
|
||||||
|
+ my $w = open_window;
|
||||||
|
+ cmd 'border normal 4';
|
||||||
|
+ is_net_frame_extents($w, [4, 4, 18, 4], "tiling window with normal border");
|
||||||
|
+
|
||||||
|
+ cmd 'floating enable';
|
||||||
|
+ is_net_frame_extents($w, [4, 4, 18, 4], "floating window with normal border");
|
||||||
|
+
|
||||||
|
+ cmd 'border pixel 2';
|
||||||
|
+ is_net_frame_extents($w, [2, 2, 2, 2], "floating window with pixel border");
|
||||||
|
+
|
||||||
|
+ cmd 'border none';
|
||||||
|
+ is_net_frame_extents($w, [0, 0, 0, 0], "floating window with no border");
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+done_testing;
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
PRGNAM=i3
|
PRGNAM=i3
|
||||||
VERSION=${VERSION:-4.24}
|
VERSION=${VERSION:-4.24}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-2}
|
||||||
TAG=${TAG:-_EXs}
|
TAG=${TAG:-_EXs}
|
||||||
|
|
||||||
if [ -z "$ARCH" ]; then
|
if [ -z "$ARCH" ]; then
|
||||||
@@ -74,6 +74,10 @@ find -L . \
|
|||||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
||||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
|
||||||
|
|
||||||
|
patch -p1 --verbose -i ${CWD}/cfa4cf16bea809c7c715a86c428757e577c85254.patch
|
||||||
|
patch -p1 --verbose -i ${CWD}/2746e0319b03a8a5a02b57a69b1fb47e0a9c22f1.patch
|
||||||
|
patch -p1 --verbose -i ${CWD}/853b0d9161a5f99c8491751590229a449e4076b6.patch
|
||||||
|
|
||||||
# Configure, build, and install:
|
# Configure, build, and install:
|
||||||
export CFLAGS="-g3 $SLKCFLAGS -flto -rdynamic"
|
export CFLAGS="-g3 $SLKCFLAGS -flto -rdynamic"
|
||||||
export CXXFLAGS="-g3 $SLKCFLAGS -flto -rdynamic"
|
export CXXFLAGS="-g3 $SLKCFLAGS -flto -rdynamic"
|
||||||
|
|||||||
8
keepassxc/keepassxc.SlackBuild
Normal file → Executable file
8
keepassxc/keepassxc.SlackBuild
Normal file → Executable file
@@ -24,7 +24,7 @@
|
|||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
PRGNAM=keepassxc
|
PRGNAM=keepassxc
|
||||||
VERSION=${VERSION:-2.7.9}
|
VERSION=${VERSION:-2.7.10}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-1}
|
||||||
TAG=${TAG:-_EXs}
|
TAG=${TAG:-_EXs}
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ cd build
|
|||||||
export CFLAGS="$SLKCFLAGS"
|
export CFLAGS="$SLKCFLAGS"
|
||||||
export CXXFLAGS="$CFLAGS -fvectorize -fno-rtti"
|
export CXXFLAGS="$CFLAGS -fvectorize -fno-rtti"
|
||||||
export LDFLAGS="-ltermcap -flto -rdynamic -Wl,--export-dynamic -Wl,-E -Wl,--no-as-needed -Wl,-s "
|
export LDFLAGS="-ltermcap -flto -rdynamic -Wl,--export-dynamic -Wl,-E -Wl,--no-as-needed -Wl,-s "
|
||||||
cmake \
|
cmake -GNinja \
|
||||||
-DCMAKE_C_FLAGS:STRING="$CFLAGS" \
|
-DCMAKE_C_FLAGS:STRING="$CFLAGS" \
|
||||||
-DCMAKE_CXX_FLAGS:STRING="$CFLAGS" \
|
-DCMAKE_CXX_FLAGS:STRING="$CFLAGS" \
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
@@ -96,8 +96,8 @@ cd build
|
|||||||
-DWITH_APP_BUNDLE=OFF \
|
-DWITH_APP_BUNDLE=OFF \
|
||||||
..
|
..
|
||||||
|
|
||||||
make -j$(nproc)
|
ninja -j$(nproc)
|
||||||
make install DESTDIR=$PKG
|
DESTDIR=$PKG ninja install
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
PRGNAM="keepassxc"
|
PRGNAM="keepassxc"
|
||||||
VERSION="2.7.9"
|
VERSION="2.7.10"
|
||||||
HOMEPAGE="https://github.com/keepassxreboot/keepassxc"
|
HOMEPAGE="https://github.com/keepassxreboot/keepassxc"
|
||||||
DOWNLOAD="https://github.com/keepassxreboot/keepassxc/releases/download/2.7.9/keepassxc-2.7.9-src.tar.xz"
|
DOWNLOAD="https://github.com/keepassxreboot/keepassxc/releases/download/2.7.10/keepassxc-2.7.10-src.tar.xz"
|
||||||
MD5SUM="1d135d224a4f6d4767caa9d8c254767e"
|
MD5SUM="31dfc525fe84bc1985bb011482b8b327"
|
||||||
DOWNLOAD_x86_64=""
|
DOWNLOAD_x86_64=""
|
||||||
MD5SUM_x86_64=""
|
MD5SUM_x86_64=""
|
||||||
REQUIRES="argon2 libsodium qrencode qt5 Botan libminizip"
|
REQUIRES="argon2 libsodium qrencode qt5 Botan libminizip"
|
||||||
|
|||||||
@@ -1,115 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Slackware build script for gitea
|
|
||||||
|
|
||||||
# Copyright 2025 Sergei Fedosoff <eleksir@gmail.com>
|
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# Redistribution and use of this script, with or without modification, is
|
|
||||||
# permitted provided that the following conditions are met:
|
|
||||||
#
|
|
||||||
# 1. Redistributions of this script must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
|
|
||||||
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
|
||||||
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
||||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
PRGNAM="ollama"
|
|
||||||
VERSION="${VERSION:-0.6.6}"
|
|
||||||
BUILD="${BUILD:-1}"
|
|
||||||
TAG="${TAG:-_EXs}"
|
|
||||||
|
|
||||||
if [ -z "$ARCH" ]; then
|
|
||||||
case "$( uname -m )" in
|
|
||||||
i?86) ARCH="i586" ;;
|
|
||||||
arm*) ARCH="arm" ;;
|
|
||||||
*) ARCH="$( uname -m )" ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
CWD="$(pwd)"
|
|
||||||
TMP="${TMP:-/tmp/EXs}"
|
|
||||||
PKG="$TMP/package-$PRGNAM"
|
|
||||||
OUTPUT="${OUTPUT:-/tmp}"
|
|
||||||
|
|
||||||
if [ "$ARCH" = "i586" ]; then
|
|
||||||
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
|
||||||
LIBDIRSUFFIX=""
|
|
||||||
elif [ "$ARCH" = "i686" ]; then
|
|
||||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
||||||
LIBDIRSUFFIX=""
|
|
||||||
elif [ "$ARCH" = "x86_64" ]; then
|
|
||||||
SLKCFLAGS="-O2 -fPIC"
|
|
||||||
LIBDIRSUFFIX="64"
|
|
||||||
else
|
|
||||||
SLKCFLAGS="-O2"
|
|
||||||
LIBDIRSUFFIX=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
USERNAME=${USERNAME:-ollama}
|
|
||||||
GROUPNAME=${GROUPNAME:-ollama}
|
|
||||||
USERID=${USERID:-5002}
|
|
||||||
GROUPID=${GROUPID:-5002}
|
|
||||||
HOMEDIR=${HOMEDIR:-/var/lib/ollama}
|
|
||||||
SHELLNAME=${SHELLNAME:-/bin/bash}
|
|
||||||
|
|
||||||
GETUSER=$(getent passwd $USERNAME)
|
|
||||||
GETGROUP=$(getent group $GROUPNAME)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [ -z "$GETUSER" -o -z "$GETGROUP" ]; then
|
|
||||||
printf "\n You must have a \"$PRGNAM\" user and a group to run this script\n\n"
|
|
||||||
[ -z "$GETGROUP" ] && printf " # groupadd -g $GROUPID $GROUPNAME\n"
|
|
||||||
[ -z "$GETUSER" ] && printf " # useradd -u $USERID -d $HOMEDIR -s $SHELLNAME -g $GROUPNAME $USERNAME\n"
|
|
||||||
printf "\n"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "$PKG"
|
|
||||||
mkdir -p "$TMP" "$PKG" "$OUTPUT"
|
|
||||||
cd "$TMP"
|
|
||||||
rm -rf "$PRGNAM-$VERSION"
|
|
||||||
tar xvf "$CWD/$PRGNAM-$VERSION.tar.gz"
|
|
||||||
cd "$PRGNAM-$VERSION"
|
|
||||||
chown -R root:root .
|
|
||||||
find -L . \
|
|
||||||
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
||||||
-o -perm 511 \) -exec chmod 755 {} \+ -o \
|
|
||||||
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
||||||
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
|
|
||||||
|
|
||||||
go build -ldflags="-s -w" -a -gcflags=all=-l -trimpath -buildvcs=false -buildmode=pie -o ollama .
|
|
||||||
|
|
||||||
install -Dpm 0755 ollama "$PKG/usr/bin/ollama"
|
|
||||||
|
|
||||||
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
|
||||||
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
||||||
|
|
||||||
|
|
||||||
for file in LICENSE README.md SECURITY.md; do
|
|
||||||
install -Dpm 0644 "$file" "${PKG}/usr/doc/${PRGNAM}-${VERSION}/${file}"
|
|
||||||
done
|
|
||||||
|
|
||||||
rsync -a "docs/" "${PKG}/usr/doc/${PRGNAM}-${VERSION}/docs"
|
|
||||||
|
|
||||||
install -Dpm 0644 "$CWD/$PRGNAM.SlackBuild" "$PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild"
|
|
||||||
|
|
||||||
pushd "$CWD"
|
|
||||||
for file in slack-desc; do
|
|
||||||
install -Dpm 0644 "$file" "$PKG/install/$file"
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
|
|
||||||
cd "$PKG"
|
|
||||||
/sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}"
|
|
||||||
|
|
||||||
# vim: ft=sh noet ai ts=4 sw=4 sts=4:
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
PRGNAM="ollama"
|
|
||||||
VERSION="0.6.6"
|
|
||||||
HOMEPAGE="https://ollama.com/"
|
|
||||||
DOWNLOAD="https://github.com/ollama/ollama/archive/refs/tags/v0.6.6/ollama-0.6.6.tar.gz"
|
|
||||||
MD5SUM="2028da0063da5a223beb60f56817eb23"
|
|
||||||
DOWNLOAD_x86_64=""
|
|
||||||
MD5SUM_x86_64=""
|
|
||||||
BUILD_REQUIRES="google-go-lang"
|
|
||||||
MAINTAINER="Sergei Fedosoff"
|
|
||||||
EMAIL="eleksir@gmail.com"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# HOW TO EDIT THIS FILE:
|
|
||||||
# The "handy ruler" below makes it easier to edit a package description.
|
|
||||||
# Line up the first '|' above the ':' following the base package name, and
|
|
||||||
# the '|' on the right side marks the last column you can put a character in.
|
|
||||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
|
||||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
|
||||||
|
|
||||||
|-----handy-ruler------------------------------------------------------|
|
|
||||||
ollama: ollama (Get up and running with large language models.)
|
|
||||||
ollama:
|
|
||||||
ollama: Run Llama 3.3, DeepSeek-R1, Qwen 3, Mistral, Gemma 3, and other
|
|
||||||
ollama: models, locally.
|
|
||||||
ollama:
|
|
||||||
ollama:
|
|
||||||
ollama:
|
|
||||||
ollama:
|
|
||||||
ollama:
|
|
||||||
ollama: Home: https://ollama.com/
|
|
||||||
ollama:
|
|
||||||
Reference in New Issue
Block a user