Init at LinuxCNC 2.9-pre-f77537cd4d
This commit is contained in:
108
README.md
Normal file
108
README.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# LinuxCNC for NixOS
|
||||
|
||||
This flake provides a `linuxcnc` package and module for NixOS, currently targeting development version LinuxCNC 2.9-pre-f77537cd4d
|
||||
|
||||
## Current Status
|
||||
|
||||
LinuxCNC can be run in a variety of configurations, and includes a wide array binaries and libraries. While this package attempts to build everything, full functionality is not guaranteed. Be aware this is an unsupported packaging of an in development branch of LinuxCNC, **proceed with appropriate caution.**
|
||||
|
||||
* Real-time with `PREEMPT_RT` is supported, tested on `x86_64` and `aarch64`. No attempt has been made to support RTAI or Xenomai.
|
||||
* The main binaries build successfully, however many required further patching to run. Some binaries installed may still have runtime issues that require further patching.
|
||||
* `linuxcnc`, `latency-test`, `latency-histogram`, `latency-plot`, `pncconf` (and related utilities, eg `halscope` etc) have been tested on `x86_64` and `aarch64` (Raspberry Pi 4 4GB), with a Mesa 7i76e.
|
||||
* **Only the AXIS GUI works at the moment.**
|
||||
* External Mesa firmware binaries are not provided. If your card does not support internal firmware, download firmware binaries from Mesa and direct pcconf to them with `HM2_FIRMWARE_DIR`, eg `HM2_FIRMWARE_DIR=/my/hm2/dir pncconf`.
|
||||
* LinuxCNC requires several binaries be `setuid root`, however NixOS forbids `setuid` binaries in the Nix store, instead wrappers must be created in the system configuration. The included module will do this automatically, enable it with `packages.linuxcnc.enable = true;`
|
||||
* `readline5` was recently dropped from nixpkgs, this flake repackages it (with upstream patches) to build without GPL3 restrictions/warnings, meaning this package should be redistributable.
|
||||
|
||||
## To-do
|
||||
|
||||
* Fix other GUIs and various quirks
|
||||
* Package other related tools
|
||||
* Add method to declaratively provide machine configurations (Currently possible with home-manager)
|
||||
* Generate SD card images for ARM devices
|
||||
* Build cache
|
||||
|
||||
## Usage
|
||||
|
||||
Add the overlay `linuxcnc-nix.overlay` and module `linuxcnc-nix.nixosModules.linuxcnc` to your configuration and set `packages.linuxcnc.enable = true;`. Ensure you are using a real-time kernel (eg `boot.kernelPackages = pkgs.linuxPackages_rt_5_10;`)
|
||||
|
||||
## Raspberry PI 4 Example Config
|
||||
|
||||
Here is a minimal config for a Raspberry Pi 4 4GB using [linux_rpi4_rt-nix](https://github.com/mattywillo/linux_rpi4_rt-nix). This works well enough to configure and jog a machine with a 2ms servo thread, but has not been tested thoroughly. Further tweaks for stability and latency may be required.
|
||||
|
||||
``` nix
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
linuxcnc-nix.url = "github:mattywillo/linuxcnc-nix";
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||
rpi4_rt.url = "github:mattywillo/linux_rpi4_rt-nix";
|
||||
};
|
||||
outputs = { self, nixpkgs, nixos-hardware, rpi4_rt, linuxcnc-nix }: {
|
||||
nixosConfigurations.linuxcnc = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
{ nixpkgs.overlays = [ rpi4_rt.overlay linuxcnc-nix.overlay ]; }
|
||||
linuxcnc-nix.nixosModules.linuxcnc
|
||||
({pkgs, lib, ...}: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
nixos-hardware.nixosModules.raspberry-pi-4
|
||||
];
|
||||
|
||||
networking.hostName = "linuxcnc";
|
||||
time.timeZone = "Australia/Perth";
|
||||
system.stateVersion = "22.05";
|
||||
|
||||
# Enable the real-time kernel and RPi bootloader
|
||||
boot.kernelPackages = pkgs.linux_rpi4_rt.linuxPackages;
|
||||
boot.loader.grub.enable = false;
|
||||
boot.loader.grub.device = "nodev";
|
||||
boot.loader.generic-extlinux-compatible.enable = lib.mkForce false;
|
||||
boot.loader.raspberryPi.enable = true;
|
||||
boot.loader.raspberryPi.version = 4;
|
||||
|
||||
# config.txt and cmdline.txt options
|
||||
boot.loader.raspberryPi.firmwareConfig = ''
|
||||
arm_freq=2000
|
||||
force_turbo=1
|
||||
|
||||
[HDMI:0]
|
||||
hdmi_group=1
|
||||
hdmi_mode=16
|
||||
'';
|
||||
boot.kernelParams = [
|
||||
"processor.max_cstate=1"
|
||||
"elevator=deadline"
|
||||
"isolcpus=1,2,3"
|
||||
"idle=poll"
|
||||
];
|
||||
|
||||
# timesyncd has known issues with LinuxCNC/PREEMPT_RT, use ntpd instead
|
||||
services.timesyncd.enable = false;
|
||||
services.ntp.enable = true;
|
||||
|
||||
# Setupd a static interface for a Mesa card
|
||||
networking.interfaces.eth0.ipv4.addresses = [{
|
||||
address = "192.168.1.1";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
|
||||
# Enable a basic interface
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager.lightdm.enable = true;
|
||||
desktopManager.xfce.enable = true;
|
||||
};
|
||||
|
||||
# Create a normal user account
|
||||
users.users.cnc = {
|
||||
isNormalUser = true;
|
||||
home = "/home/cnc";
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
10
default.nix
Normal file
10
default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
(import
|
||||
(
|
||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
||||
fetchTarball {
|
||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||
}
|
||||
)
|
||||
{ src = ./.; }
|
||||
).defaultNix
|
||||
43
flake.lock
generated
Normal file
43
flake.lock
generated
Normal file
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1650374568,
|
||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1653845079,
|
||||
"narHash": "sha256-7ghaQZ+7JXLI9FgNH8+RQHAt3/ubT92j8NtjZleP6t4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b62ada430501de88dfbb08cea4eb98ead3a5e3e7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
17
flake.nix
Normal file
17
flake.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-compat }@inputs:
|
||||
let
|
||||
systems = nixpkgs.lib.platforms.linux;
|
||||
lib = nixpkgs.lib;
|
||||
packagePaths = lib.mapAttrs (n: v: "${./packages}/${n}") (lib.filterAttrs (n: v: v == "directory" && (builtins.readDir "${./packages}/${n}") ? "default.nix") (builtins.readDir ./packages));
|
||||
in rec {
|
||||
packages = lib.genAttrs systems (system: lib.mapAttrs (n: v: lib.callPackageWith ((lib.recursiveUpdate packages.${system} nixpkgs.legacyPackages.${system}) // { inherit inputs; inherit system; }) v {}) packagePaths);
|
||||
legacyPackages = packages;
|
||||
overlay = final: prev: (lib.mapAttrs (n: v: prev.callPackage v { }) packagePaths);
|
||||
nixosModules = { linuxcnc = import ./modules/linuxcnc.nix; };
|
||||
};
|
||||
}
|
||||
21
modules/linuxcnc.nix
Normal file
21
modules/linuxcnc.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.local.packages.linuxcnc;
|
||||
inherit (builtins) filter map pathExists listToAttrs;
|
||||
in {
|
||||
options.local.packages.linuxcnc.enable = lib.mkEnableOption "Enable linuxcnc";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [ linuxcnc ];
|
||||
|
||||
security.wrappers = listToAttrs (map (f: {
|
||||
name = f;
|
||||
value = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.linuxcnc}/bin/${f}-nosetuid";
|
||||
};
|
||||
}) (filter (f: pathExists "${pkgs.linuxcnc}/bin/${f}-nosetuid") pkgs.linuxcnc.setuidApps));
|
||||
};
|
||||
}
|
||||
120
packages/linuxcnc/default.nix
Normal file
120
packages/linuxcnc/default.nix
Normal file
@@ -0,0 +1,120 @@
|
||||
{ lib, stdenv, autoreconfHook, wrapGAppsHook, qt5, makeWrapper, fetchFromGitHub, libtool, pkgconfig,
|
||||
readline_5, ncurses, libtirpc, systemd, libmodbus, libusb, glib, gtk2, gtk3, procps, kmod, sysctl,
|
||||
util-linux, psmisc, intltool, tcl, tk, bwidget, tkimg, tclx, tkblt, pango, cairo, boost, espeak, gst_all_1,
|
||||
python3Full, yapps, gobject-introspection, libGLU, xorg, libepoxy, hicolor-icon-theme, glxinfo, bash
|
||||
}:
|
||||
let
|
||||
pythonPkg = (python3Full.withPackages (ps: [
|
||||
yapps
|
||||
ps.pyopengl
|
||||
ps.pygobject3
|
||||
ps.pycairo
|
||||
ps.boost
|
||||
ps.numpy
|
||||
ps.pyqtwebengine
|
||||
ps.pyqt5
|
||||
ps.opencv4
|
||||
ps.gst-python
|
||||
ps.xlib
|
||||
ps.qscintilla
|
||||
]));
|
||||
boost_python = (boost.override { enablePython = true; python = pythonPkg; });
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
hardeningDisable = [ "all" ];
|
||||
enableParalellBuilding = true;
|
||||
pname = "linuxcnc";
|
||||
version = "2.9-git";
|
||||
name = "${pname}-${version}";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "LinuxCNC";
|
||||
repo = "linuxcnc";
|
||||
rev = "f77537cd4d4dc6191d4bb981e0e1c9d897039fc6";
|
||||
sha256 = "05kuTx2J7wdrcoUQ8Tengb0ohXAeGjZV9g9XriWgQL4=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
makeWrapper
|
||||
wrapGAppsHook
|
||||
qt5.wrapQtAppsHook
|
||||
gobject-introspection
|
||||
];
|
||||
|
||||
dontWrapGApps = true;
|
||||
dontWrapQtApps = true;
|
||||
|
||||
buildInputs = [
|
||||
libtool pkgconfig libtirpc systemd libmodbus libusb glib gtk2 gtk3 procps kmod sysctl util-linux
|
||||
psmisc intltool tcl tk bwidget tkimg tclx tkblt pango cairo pythonPkg.pkgs.pygobject3 gobject-introspection
|
||||
boost_python pythonPkg.pkgs.boost pythonPkg qt5.qtbase espeak gst_all_1.gstreamer
|
||||
ncurses readline_5 libGLU xorg.libXmu libepoxy hicolor-icon-theme glxinfo
|
||||
];
|
||||
|
||||
preAutoreconf = ''
|
||||
# cd into ./src here instead of setting sourceRoot as the build process uses the original sourceRoot
|
||||
cd ./src
|
||||
|
||||
# make halcmd search for setuid apps on PATH, to find setuid wrappers
|
||||
substituteInPlace hal/utils/halcmd_commands.c --replace 'EMC2_BIN_DIR "/' '"'
|
||||
'';
|
||||
|
||||
patches = [
|
||||
./fix_make.patch # Some lines don't respect --prefix
|
||||
./pncconf_paths.patch # Corrects a search path in pncconf
|
||||
./rtapi_app_setuid.patch # Remove hard coded checks for setuid from rtapi_app
|
||||
];
|
||||
|
||||
postAutoreconf = ''
|
||||
# We need -lncurses for -lreadline, but the configure script discards the env set by NixOS before checking for -lreadline
|
||||
substituteInPlace configure --replace '-lreadline' '-lreadline -lncurses'
|
||||
|
||||
substituteInPlace emc/usr_intf/pncconf/private_data.py --replace '/usr/share/themes' '${gtk3}/share/themes'
|
||||
substituteInPlace emc/usr_intf/pncconf/private_data.py --replace 'self.FIRMDIR = "/lib/firmware/hm2/"' 'self.FIRMDIR = os.environ.get("HM2_FIRMWARE_DIR", "${placeholder "out"}/firmware/hm2")'
|
||||
|
||||
substituteInPlace hal/drivers/mesa-hostmot2/hm2_eth.c --replace '/sbin/iptables' '/run/current-system/sw/bin/iptables'
|
||||
substituteInPlace hal/drivers/mesa-hostmot2/hm2_eth.c --replace '/sbin/sysctl' '${sysctl}/bin/sysctl'
|
||||
substituteInPlace hal/drivers/mesa-hostmot2/hm2_rpspi.c --replace '/sbin/modprobe' '${kmod}/bin/modprobe'
|
||||
substituteInPlace hal/drivers/mesa-hostmot2/hm2_rpspi.c --replace '/sbin/rmmod' '${kmod}/bin/rmmod'
|
||||
substituteInPlace module_helper/module_helper.c --replace '/sbin/insmod' '${kmod}/bin/insmod'
|
||||
substituteInPlace module_helper/module_helper.c --replace '/sbin/rmmod' '${kmod}/bin/rmmod'
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--with-tclConfig=${tcl}/lib/tclConfig.sh"
|
||||
"--with-tkConfig=${tk}/lib/tkConfig.sh"
|
||||
"--with-boost-libdir=${boost_python}/lib"
|
||||
"--with-boost-python=boost_python3"
|
||||
"--with-locale-dir=$(out)/locale"
|
||||
"--exec-prefix=${placeholder "out"}"
|
||||
];
|
||||
|
||||
preInstall = ''
|
||||
# Stop the Makefile attempting to set ownship+perms, it fails on NixOS
|
||||
sed -i -e 's/chown.*//' -e 's/-o root//g' -e 's/-m [0-9]\+//g' Makefile
|
||||
'';
|
||||
|
||||
installFlags = [ "SITEPY=${placeholder "out"}/${pythonPkg.sitePackages}" ];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p "$out/firmware/hm2"
|
||||
'';
|
||||
|
||||
# Binaries listed here are renamed to ${filename}-nosetuid, to be targetted by setuid wrappers
|
||||
setuidApps = [ "rtapi_app" "linuxcnc_module_helper" "pci_write" "pci_read" ];
|
||||
|
||||
preFixup = ''
|
||||
for prog in $(find $out/bin -type f ! \( ${lib.concatMapStringsSep " -o " (f: "-name " + f + " ") setuidApps} \)); do
|
||||
wrapProgram "$prog" \
|
||||
--prefix PATH : ${lib.makeBinPath [tk glxinfo]} \
|
||||
--prefix TCLLIBPATH ' ' "$out/lib/tcltk/linuxcnc ${tk}/lib ${tcl}/lib ${tclx}/lib ${tkblt}/lib ${tkimg}/lib ${bwidget}/lib/bwidget${bwidget.version}" \
|
||||
--prefix PYTHONPATH : "${pythonPkg}/${pythonPkg.sitePackages}:$out/${pythonPkg.sitePackages}" \
|
||||
"''${gappsWrapperArgs[@]}" \
|
||||
"''${qtWrapperArgs[@]}"
|
||||
done
|
||||
for prog in $(find $out/bin -type f \( ${lib.concatMapStringsSep " -o " (f: "-name " + f + " ") setuidApps} \)); do
|
||||
mv "$prog" "$prog-nosetuid"
|
||||
done
|
||||
'';
|
||||
}
|
||||
25
packages/linuxcnc/fix_make.patch
Normal file
25
packages/linuxcnc/fix_make.patch
Normal file
@@ -0,0 +1,25 @@
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 5bde17598d..856af19e08 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -616,9 +616,9 @@ install: install-kernel-dep install-kernel-indep
|
||||
install-dirs:
|
||||
$(DIR) $(DESTDIR)$(EMC2_RTLIB_DIR) \
|
||||
$(DESTDIR)$(sysconfdir)/linuxcnc $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) \
|
||||
- $(DESTDIR)/lib/linuxcnc $(DESTDIR)$(includedir)/linuxcnc \
|
||||
+ $(DESTDIR)$(prefix)/lib/linuxcnc $(DESTDIR)$(includedir)/linuxcnc \
|
||||
$(DESTDIR)$(docsdir) $(DESTDIR)$(ncfilesdir) \
|
||||
- $(DESTDIR)/etc/X11/app-defaults $(DESTDIR)$(tcldir)/bin \
|
||||
+ $(DESTDIR)$(prefix)/etc/X11/app-defaults $(DESTDIR)$(tcldir)/bin \
|
||||
$(DESTDIR)$(tcldir)/scripts \
|
||||
$(DESTDIR)$(mandir)/man1 \
|
||||
$(DESTDIR)$(mandir)/man3 \
|
||||
@@ -686,7 +686,7 @@ install-kernel-indep: install-dirs
|
||||
$(FILE) $(DOCS_HELP) $(DESTDIR)$(docsdir)
|
||||
$(TREE) $(NC_FILES) $(DESTDIR)$(ncfilesdir)
|
||||
$(EXE) ../nc_files/M101 $(DESTDIR)$(ncfilesdir)
|
||||
- $(FILE) ../tcl/TkLinuxCNC $(DESTDIR)/etc/X11/app-defaults
|
||||
+ $(FILE) ../tcl/TkLinuxCNC $(DESTDIR)$(prefix)/etc/X11/app-defaults
|
||||
$(FILE) Makefile.modinc $(DESTDIR)$(datadir)/linuxcnc
|
||||
$(EXE) $(TCL) $(DESTDIR)$(tcldir)
|
||||
$(FILE) ../tcl/hal.so $(DESTDIR)$(tcldir)
|
||||
13
packages/linuxcnc/pncconf_paths.patch
Normal file
13
packages/linuxcnc/pncconf_paths.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/emc/usr_intf/pncconf/private_data.py b/src/emc/usr_intf/pncconf/private_data.py
|
||||
index 7bb8127ea4..88e99934ca 100644
|
||||
--- a/src/emc/usr_intf/pncconf/private_data.py
|
||||
+++ b/src/emc/usr_intf/pncconf/private_data.py
|
||||
@@ -74,7 +74,7 @@ class Private_Data:
|
||||
self._METRIC = 1
|
||||
|
||||
self.DATADIR = linuxcnc.SHARE + "/linuxcnc/pncconf"
|
||||
- self.WIZARD = os.path.join(self.DATADIR, "linuxcnc-wizard.gif")
|
||||
+ self.WIZARD = linuxcnc.SHARE + "/linuxcnc/linuxcnc-wizard.gif"
|
||||
if not os.path.isfile(self.WIZARD):
|
||||
self.WIZARD = os.path.join("/etc/linuxcnc/linuxcnc-wizard.gif")
|
||||
if not os.path.isfile(self.WIZARD):
|
||||
19
packages/linuxcnc/rtapi_app_setuid.patch
Normal file
19
packages/linuxcnc/rtapi_app_setuid.patch
Normal file
@@ -0,0 +1,19 @@
|
||||
diff --git a/src/rtapi/uspace_common.h b/src/rtapi/uspace_common.h
|
||||
index 8dde420142..f9ff6f0cb2 100644
|
||||
--- a/src/rtapi/uspace_common.h
|
||||
+++ b/src/rtapi/uspace_common.h
|
||||
@@ -381,9 +381,11 @@ static int detect_env_override() {
|
||||
|
||||
static int detect_realtime() {
|
||||
struct stat st;
|
||||
- if ((stat(EMC2_BIN_DIR "/rtapi_app", &st) < 0)
|
||||
- || st.st_uid != 0 || !(st.st_mode & S_ISUID))
|
||||
- return 0;
|
||||
+ //setuid programs are forbidden from the nix store, a wrapper outside of the store is created instead
|
||||
+ //this check fails under those circumstances, disable it and hope for the best
|
||||
+ /* if ((stat(EMC2_BIN_DIR "/rtapi_app", &st) < 0) */
|
||||
+ /* || st.st_uid != 0 || !(st.st_mode & S_ISUID)) */
|
||||
+ /* return 0; */
|
||||
return detect_env_override() || detect_preempt_rt() || detect_rtai() || detect_xenomai();
|
||||
}
|
||||
|
||||
20
packages/readline_5/default.nix
Normal file
20
packages/readline_5/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ fetchurl, stdenv, ncurses, lib }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "readline";
|
||||
version = "5.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/readline/readline-${version}.tar.gz";
|
||||
sha256 = "0icz4hqqq8mlkwrpczyaha94kns0am9z0mh3a2913kg2msb8vs0j";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ncurses];
|
||||
|
||||
patches = [ ./gnu_patches.patch ];
|
||||
|
||||
meta = with lib; {
|
||||
branch = "5";
|
||||
platforms = platforms.unix;
|
||||
license = licenses.gpl2;
|
||||
};
|
||||
}
|
||||
708
packages/readline_5/gnu_patches.patch
Normal file
708
packages/readline_5/gnu_patches.patch
Normal file
@@ -0,0 +1,708 @@
|
||||
diff --git a/complete.c b/complete.c
|
||||
index 73f834a..5ff198d 100644
|
||||
--- a/complete.c
|
||||
+++ b/complete.c
|
||||
@@ -428,7 +428,7 @@ get_y_or_n (for_pager)
|
||||
return (1);
|
||||
if (c == 'n' || c == 'N' || c == RUBOUT)
|
||||
return (0);
|
||||
- if (c == ABORT_CHAR)
|
||||
+ if (c == ABORT_CHAR || c < 0)
|
||||
_rl_abort_internal ();
|
||||
if (for_pager && (c == NEWLINE || c == RETURN))
|
||||
return (2);
|
||||
diff --git a/display.c b/display.c
|
||||
index 47ff061..2a482ef 100644
|
||||
--- a/display.c
|
||||
+++ b/display.c
|
||||
@@ -391,14 +391,14 @@ rl_expand_prompt (prompt)
|
||||
t = ++p;
|
||||
local_prompt = expand_prompt (p, &prompt_visible_length,
|
||||
&prompt_last_invisible,
|
||||
- (int *)NULL,
|
||||
+ &prompt_invis_chars_first_line,
|
||||
&prompt_physical_chars);
|
||||
c = *t; *t = '\0';
|
||||
/* The portion of the prompt string up to and including the
|
||||
final newline is now null-terminated. */
|
||||
local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
|
||||
(int *)NULL,
|
||||
- &prompt_invis_chars_first_line,
|
||||
+ (int *)NULL,
|
||||
(int *)NULL);
|
||||
*t = c;
|
||||
local_prompt_len = local_prompt ? strlen (local_prompt) : 0;
|
||||
@@ -561,6 +561,17 @@ rl_redisplay ()
|
||||
wrap_offset = prompt_invis_chars_first_line = 0;
|
||||
}
|
||||
|
||||
+#if defined (HANDLE_MULTIBYTE)
|
||||
+#define CHECK_INV_LBREAKS() \
|
||||
+ do { \
|
||||
+ if (newlines >= (inv_lbsize - 2)) \
|
||||
+ { \
|
||||
+ inv_lbsize *= 2; \
|
||||
+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
|
||||
+ _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
|
||||
+ } \
|
||||
+ } while (0)
|
||||
+#else
|
||||
#define CHECK_INV_LBREAKS() \
|
||||
do { \
|
||||
if (newlines >= (inv_lbsize - 2)) \
|
||||
@@ -569,6 +580,7 @@ rl_redisplay ()
|
||||
inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
|
||||
} \
|
||||
} while (0)
|
||||
+#endif /* HANDLE_MULTIBYTE */
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
#define CHECK_LPOS() \
|
||||
@@ -898,6 +910,10 @@ rl_redisplay ()
|
||||
second and subsequent lines start at inv_lbreaks[N], offset by
|
||||
OFFSET (which has already been calculated above). */
|
||||
|
||||
+#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
|
||||
+#define WRAP_OFFSET(line, offset) ((line == 0) \
|
||||
+ ? (offset ? INVIS_FIRST() : 0) \
|
||||
+ : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
|
||||
#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
|
||||
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
|
||||
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
|
||||
@@ -932,7 +948,13 @@ rl_redisplay ()
|
||||
_rl_last_c_pos != o_cpos &&
|
||||
_rl_last_c_pos > wrap_offset &&
|
||||
o_cpos < prompt_last_invisible)
|
||||
- _rl_last_c_pos -= wrap_offset;
|
||||
+ _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */
|
||||
+ else if (linenum == prompt_last_screen_line && prompt_physical_chars > _rl_screenwidth &&
|
||||
+ (MB_CUR_MAX > 1 && rl_byte_oriented == 0) &&
|
||||
+ cpos_adjusted == 0 &&
|
||||
+ _rl_last_c_pos != o_cpos &&
|
||||
+ _rl_last_c_pos > (prompt_last_invisible - _rl_screenwidth - prompt_invis_chars_first_line))
|
||||
+ _rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
|
||||
|
||||
/* If this is the line with the prompt, we might need to
|
||||
compensate for invisible characters in the new line. Do
|
||||
@@ -1036,7 +1058,7 @@ rl_redisplay ()
|
||||
tx = _rl_col_width (&visible_line[pos], 0, nleft) - visible_wrap_offset;
|
||||
else
|
||||
tx = nleft;
|
||||
- if (_rl_last_c_pos > tx)
|
||||
+ if (tx >= 0 && _rl_last_c_pos > tx)
|
||||
{
|
||||
_rl_backspace (_rl_last_c_pos - tx); /* XXX */
|
||||
_rl_last_c_pos = tx;
|
||||
@@ -1192,7 +1214,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
int current_line, omax, nmax, inv_botlin;
|
||||
{
|
||||
register char *ofd, *ols, *oe, *nfd, *nls, *ne;
|
||||
- int temp, lendiff, wsatend, od, nd;
|
||||
+ int temp, lendiff, wsatend, od, nd, twidth, o_cpos;
|
||||
int current_invis_chars;
|
||||
int col_lendiff, col_temp;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
@@ -1208,7 +1230,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
temp = _rl_last_c_pos;
|
||||
else
|
||||
- temp = _rl_last_c_pos - W_OFFSET(_rl_last_v_pos, visible_wrap_offset);
|
||||
+ temp = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset);
|
||||
if (temp == _rl_screenwidth && _rl_term_autowrap && !_rl_horizontal_scroll_mode
|
||||
&& _rl_last_v_pos == current_line - 1)
|
||||
{
|
||||
@@ -1453,6 +1475,8 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
_rl_last_c_pos = lendiff;
|
||||
}
|
||||
|
||||
+ o_cpos = _rl_last_c_pos;
|
||||
+
|
||||
/* When this function returns, _rl_last_c_pos is correct, and an absolute
|
||||
cursor postion in multibyte mode, but a buffer index when not in a
|
||||
multibyte locale. */
|
||||
@@ -1462,7 +1486,9 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
/* We need to indicate that the cursor position is correct in the presence of
|
||||
invisible characters in the prompt string. Let's see if setting this when
|
||||
we make sure we're at the end of the drawn prompt string works. */
|
||||
- if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars)
|
||||
+ if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 &&
|
||||
+ (_rl_last_c_pos > 0 || o_cpos > 0) &&
|
||||
+ _rl_last_c_pos == prompt_physical_chars)
|
||||
cpos_adjusted = 1;
|
||||
#endif
|
||||
#endif
|
||||
@@ -1506,11 +1532,31 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
{
|
||||
/* Non-zero if we're increasing the number of lines. */
|
||||
int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
|
||||
+ /* If col_lendiff is > 0, implying that the new string takes up more
|
||||
+ screen real estate than the old, but lendiff is < 0, meaning that it
|
||||
+ takes fewer bytes, we need to just output the characters starting
|
||||
+ from the first difference. These will overwrite what is on the
|
||||
+ display, so there's no reason to do a smart update. This can really
|
||||
+ only happen in a multibyte environment. */
|
||||
+ if (lendiff < 0)
|
||||
+ {
|
||||
+ _rl_output_some_chars (nfd, temp);
|
||||
+ _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
|
||||
+ /* If nfd begins before any invisible characters in the prompt,
|
||||
+ adjust _rl_last_c_pos to account for wrap_offset and set
|
||||
+ cpos_adjusted to let the caller know. */
|
||||
+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
|
||||
+ {
|
||||
+ _rl_last_c_pos -= wrap_offset;
|
||||
+ cpos_adjusted = 1;
|
||||
+ }
|
||||
+ return;
|
||||
+ }
|
||||
/* Sometimes it is cheaper to print the characters rather than
|
||||
use the terminal's capabilities. If we're growing the number
|
||||
of lines, make sure we actually cause the new line to wrap
|
||||
around on auto-wrapping terminals. */
|
||||
- if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
|
||||
+ else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
|
||||
{
|
||||
/* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
|
||||
_rl_horizontal_scroll_mode == 1, inserting the characters with
|
||||
@@ -1533,11 +1579,16 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* We have horizontal scrolling and we are not inserting at
|
||||
- the end. We have invisible characters in this line. This
|
||||
- is a dumb update. */
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
_rl_last_c_pos += col_temp;
|
||||
+ /* If nfd begins before any invisible characters in the prompt,
|
||||
+ adjust _rl_last_c_pos to account for wrap_offset and set
|
||||
+ cpos_adjusted to let the caller know. */
|
||||
+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
|
||||
+ {
|
||||
+ _rl_last_c_pos -= wrap_offset;
|
||||
+ cpos_adjusted = 1;
|
||||
+ }
|
||||
return;
|
||||
}
|
||||
/* Copy (new) chars to screen from first diff to last match. */
|
||||
@@ -1545,15 +1596,15 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
if ((temp - lendiff) > 0)
|
||||
{
|
||||
_rl_output_some_chars (nfd + lendiff, temp - lendiff);
|
||||
-#if 1
|
||||
/* XXX -- this bears closer inspection. Fixes a redisplay bug
|
||||
reported against bash-3.0-alpha by Andreas Schwab involving
|
||||
multibyte characters and prompt strings with invisible
|
||||
characters, but was previously disabled. */
|
||||
- _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
|
||||
-#else
|
||||
- _rl_last_c_pos += _rl_col_width (nfd+lendiff, 0, temp-lendiff);
|
||||
-#endif
|
||||
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
+ twidth = _rl_col_width (nfd+lendiff, 0, temp-col_lendiff);
|
||||
+ else
|
||||
+ twidth = temp - lendiff;
|
||||
+ _rl_last_c_pos += twidth;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1586,8 +1637,22 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
temp = nls - nfd;
|
||||
if (temp > 0)
|
||||
{
|
||||
+ /* If nfd begins at the prompt, or before the invisible
|
||||
+ characters in the prompt, we need to adjust _rl_last_c_pos
|
||||
+ in a multibyte locale to account for the wrap offset and
|
||||
+ set cpos_adjusted accordingly. */
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
- _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
|
||||
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
+ {
|
||||
+ _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
|
||||
+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
|
||||
+ {
|
||||
+ _rl_last_c_pos -= wrap_offset;
|
||||
+ cpos_adjusted = 1;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ _rl_last_c_pos += temp;
|
||||
}
|
||||
}
|
||||
/* Otherwise, print over the existing material. */
|
||||
@@ -1595,8 +1660,20 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
{
|
||||
if (temp > 0)
|
||||
{
|
||||
+ /* If nfd begins at the prompt, or before the invisible
|
||||
+ characters in the prompt, we need to adjust _rl_last_c_pos
|
||||
+ in a multibyte locale to account for the wrap offset and
|
||||
+ set cpos_adjusted accordingly. */
|
||||
_rl_output_some_chars (nfd, temp);
|
||||
_rl_last_c_pos += col_temp; /* XXX */
|
||||
+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
+ {
|
||||
+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
|
||||
+ {
|
||||
+ _rl_last_c_pos -= wrap_offset;
|
||||
+ cpos_adjusted = 1;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
lendiff = (oe - old) - (ne - new);
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
@@ -1721,7 +1798,7 @@ _rl_move_cursor_relative (new, data)
|
||||
int woff; /* number of invisible chars on current line */
|
||||
int cpos, dpos; /* current and desired cursor positions */
|
||||
|
||||
- woff = W_OFFSET (_rl_last_v_pos, wrap_offset);
|
||||
+ woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset);
|
||||
cpos = _rl_last_c_pos;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
/* If we have multibyte characters, NEW is indexed by the buffer point in
|
||||
@@ -1732,7 +1809,14 @@ _rl_move_cursor_relative (new, data)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
{
|
||||
dpos = _rl_col_width (data, 0, new);
|
||||
- if (dpos > prompt_last_invisible) /* XXX - don't use woff here */
|
||||
+ /* Use NEW when comparing against the last invisible character in the
|
||||
+ prompt string, since they're both buffer indices and DPOS is a
|
||||
+ desired display position. */
|
||||
+ if ((new > prompt_last_invisible) || /* XXX - don't use woff here */
|
||||
+ (prompt_physical_chars > _rl_screenwidth &&
|
||||
+ _rl_last_v_pos == prompt_last_screen_line &&
|
||||
+ wrap_offset != woff &&
|
||||
+ new > (prompt_last_invisible-_rl_screenwidth-wrap_offset)))
|
||||
{
|
||||
dpos -= woff;
|
||||
/* Since this will be assigned to _rl_last_c_pos at the end (more
|
||||
@@ -2380,6 +2464,8 @@ _rl_col_width (str, start, end)
|
||||
|
||||
if (end <= start)
|
||||
return 0;
|
||||
+ if (MB_CUR_MAX == 1 || rl_byte_oriented)
|
||||
+ return (end - start);
|
||||
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
|
||||
diff --git a/input.c b/input.c
|
||||
index da5d771..4206a3e 100644
|
||||
--- a/input.c
|
||||
+++ b/input.c
|
||||
@@ -133,8 +133,11 @@ rl_get_char (key)
|
||||
return (0);
|
||||
|
||||
*key = ibuffer[pop_index++];
|
||||
-
|
||||
+#if 0
|
||||
if (pop_index >= ibuffer_len)
|
||||
+#else
|
||||
+ if (pop_index > ibuffer_len)
|
||||
+#endif
|
||||
pop_index = 0;
|
||||
|
||||
return (1);
|
||||
@@ -151,7 +154,7 @@ _rl_unget_char (key)
|
||||
{
|
||||
pop_index--;
|
||||
if (pop_index < 0)
|
||||
- pop_index = ibuffer_len - 1;
|
||||
+ pop_index = ibuffer_len;
|
||||
ibuffer[pop_index] = key;
|
||||
return (1);
|
||||
}
|
||||
@@ -250,7 +253,8 @@ rl_gather_tyi ()
|
||||
while (chars_avail--)
|
||||
{
|
||||
k = (*rl_getc_function) (rl_instream);
|
||||
- rl_stuff_char (k);
|
||||
+ if (rl_stuff_char (k) == 0)
|
||||
+ break; /* some problem; no more room */
|
||||
if (k == NEWLINE || k == RETURN)
|
||||
break;
|
||||
}
|
||||
@@ -373,7 +377,11 @@ rl_stuff_char (key)
|
||||
RL_SETSTATE (RL_STATE_INPUTPENDING);
|
||||
}
|
||||
ibuffer[push_index++] = key;
|
||||
+#if 0
|
||||
if (push_index >= ibuffer_len)
|
||||
+#else
|
||||
+ if (push_index > ibuffer_len)
|
||||
+#endif
|
||||
push_index = 0;
|
||||
|
||||
return 1;
|
||||
@@ -513,20 +521,26 @@ _rl_read_mbchar (mbchar, size)
|
||||
char *mbchar;
|
||||
int size;
|
||||
{
|
||||
- int mb_len = 0;
|
||||
+ int mb_len, c;
|
||||
size_t mbchar_bytes_length;
|
||||
wchar_t wc;
|
||||
mbstate_t ps, ps_back;
|
||||
|
||||
memset(&ps, 0, sizeof (mbstate_t));
|
||||
memset(&ps_back, 0, sizeof (mbstate_t));
|
||||
-
|
||||
+
|
||||
+ mb_len = 0;
|
||||
while (mb_len < size)
|
||||
{
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
- mbchar[mb_len++] = rl_read_key ();
|
||||
+ c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
+ if (c < 0)
|
||||
+ break;
|
||||
+
|
||||
+ mbchar[mb_len++] = c;
|
||||
+
|
||||
mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
|
||||
if (mbchar_bytes_length == (size_t)(-1))
|
||||
break; /* invalid byte sequence for the current locale */
|
||||
@@ -564,7 +578,7 @@ _rl_read_mbstring (first, mb, mlen)
|
||||
|
||||
c = first;
|
||||
memset (mb, 0, mlen);
|
||||
- for (i = 0; i < mlen; i++)
|
||||
+ for (i = 0; c >= 0 && i < mlen; i++)
|
||||
{
|
||||
mb[i] = (char)c;
|
||||
memset (&ps, 0, sizeof (mbstate_t));
|
||||
diff --git a/isearch.c b/isearch.c
|
||||
index 9f67bfc..2ed459f 100644
|
||||
--- a/isearch.c
|
||||
+++ b/isearch.c
|
||||
@@ -327,8 +327,15 @@ _rl_isearch_dispatch (cxt, c)
|
||||
rl_command_func_t *f;
|
||||
|
||||
f = (rl_command_func_t *)NULL;
|
||||
-
|
||||
- /* Translate the keys we do something with to opcodes. */
|
||||
+
|
||||
+ if (c < 0)
|
||||
+ {
|
||||
+ cxt->sflags |= SF_FAILED;
|
||||
+ cxt->history_pos = cxt->last_found_line;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Translate the keys we do something with to opcodes. */
|
||||
if (c >= 0 && _rl_keymap[c].type == ISFUNC)
|
||||
{
|
||||
f = _rl_keymap[c].function;
|
||||
diff --git a/mbutil.c b/mbutil.c
|
||||
index 17dde53..974096e 100644
|
||||
--- a/mbutil.c
|
||||
+++ b/mbutil.c
|
||||
@@ -77,7 +77,7 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
|
||||
char *string;
|
||||
int seed, count, find_non_zero;
|
||||
{
|
||||
- size_t tmp;
|
||||
+ size_t tmp, len;
|
||||
mbstate_t ps;
|
||||
int point;
|
||||
wchar_t wc;
|
||||
@@ -98,7 +98,10 @@ _rl_find_next_mbchar_internal (string, seed, count, find_non_zero)
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
- tmp = mbrtowc (&wc, string+point, strlen(string + point), &ps);
|
||||
+ len = strlen (string + point);
|
||||
+ if (len == 0)
|
||||
+ break;
|
||||
+ tmp = mbrtowc (&wc, string+point, len, &ps);
|
||||
if (MB_INVALIDCH ((size_t)tmp))
|
||||
{
|
||||
/* invalid bytes. asume a byte represents a character */
|
||||
diff --git a/misc.c b/misc.c
|
||||
index 94ecb25..e9c72c5 100644
|
||||
--- a/misc.c
|
||||
+++ b/misc.c
|
||||
@@ -146,6 +146,8 @@ _rl_arg_dispatch (cxt, c)
|
||||
rl_restore_prompt ();
|
||||
rl_clear_message ();
|
||||
RL_UNSETSTATE(RL_STATE_NUMERICARG);
|
||||
+ if (key < 0)
|
||||
+ return -1;
|
||||
return (_rl_dispatch (key, _rl_keymap));
|
||||
}
|
||||
}
|
||||
diff --git a/readline.c b/readline.c
|
||||
index c2b7400..bd4d263 100644
|
||||
--- a/readline.c
|
||||
+++ b/readline.c
|
||||
@@ -645,6 +645,11 @@ _rl_dispatch_callback (cxt)
|
||||
if ((cxt->flags & KSEQ_DISPATCHED) == 0)
|
||||
{
|
||||
nkey = _rl_subseq_getchar (cxt->okey);
|
||||
+ if (nkey < 0)
|
||||
+ {
|
||||
+ _rl_abort_internal ();
|
||||
+ return -1;
|
||||
+ }
|
||||
r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
|
||||
cxt->flags |= KSEQ_DISPATCHED;
|
||||
}
|
||||
diff --git a/support/shobj-conf b/support/shobj-conf
|
||||
index ef7863a..358b278 100755
|
||||
--- a/support/shobj-conf
|
||||
+++ b/support/shobj-conf
|
||||
@@ -10,7 +10,7 @@
|
||||
# Chet Ramey
|
||||
# chet@po.cwru.edu
|
||||
|
||||
-# Copyright (C) 1996-2002 Free Software Foundation, Inc.
|
||||
+# Copyright (C) 1996-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -114,7 +114,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
|
||||
;;
|
||||
|
||||
-freebsd2* | netbsd*)
|
||||
+freebsd2*)
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
SHOBJ_LD=ld
|
||||
SHOBJ_LDFLAGS='-x -Bshareable'
|
||||
@@ -125,7 +125,7 @@ freebsd2* | netbsd*)
|
||||
|
||||
# FreeBSD-3.x ELF
|
||||
freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
|
||||
- SHOBJ_CFLAGS=-fpic
|
||||
+ SHOBJ_CFLAGS=-fPIC
|
||||
SHOBJ_LD='${CC}'
|
||||
|
||||
if [ -x /usr/bin/objformat ] && [ "`/usr/bin/objformat`" = "elf" ]; then
|
||||
@@ -142,7 +142,7 @@ freebsd[3-9]*|freebsdelf[3-9]*|freebsdaout[3-9]*|dragonfly*)
|
||||
;;
|
||||
|
||||
# Darwin/MacOS X
|
||||
-darwin8*)
|
||||
+darwin[89]*)
|
||||
SHOBJ_STATUS=supported
|
||||
SHLIB_STATUS=supported
|
||||
|
||||
@@ -153,7 +153,7 @@ darwin8*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
|
||||
SHLIB_LIBSUFF='dylib'
|
||||
|
||||
- SHOBJ_LDFLAGS='-undefined dynamic_lookup'
|
||||
+ SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
|
||||
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
|
||||
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
|
||||
@@ -171,7 +171,7 @@ darwin*|macosx*)
|
||||
SHLIB_LIBSUFF='dylib'
|
||||
|
||||
case "${host_os}" in
|
||||
- darwin[78]*) SHOBJ_LDFLAGS=''
|
||||
+ darwin[789]*) SHOBJ_LDFLAGS=''
|
||||
SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
|
||||
;;
|
||||
*) SHOBJ_LDFLAGS='-dynamic'
|
||||
@@ -182,7 +182,7 @@ darwin*|macosx*)
|
||||
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
|
||||
;;
|
||||
|
||||
-openbsd*)
|
||||
+openbsd*|netbsd*)
|
||||
SHOBJ_CFLAGS=-fPIC
|
||||
SHOBJ_LD='${CC}'
|
||||
SHOBJ_LDFLAGS='-shared'
|
||||
@@ -247,7 +247,7 @@ osf*)
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||
;;
|
||||
|
||||
-aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
|
||||
+aix4.[2-9]*-*gcc*|aix[5-9].*-*gcc*) # lightly tested by jik@cisco.com
|
||||
SHOBJ_CFLAGS=-fpic
|
||||
SHOBJ_LD='ld'
|
||||
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
|
||||
@@ -258,7 +258,7 @@ aix4.[2-9]*-*gcc*) # lightly tested by jik@cisco.com
|
||||
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
|
||||
;;
|
||||
|
||||
-aix4.[2-9]*)
|
||||
+aix4.[2-9]*|aix[5-9].*)
|
||||
SHOBJ_CFLAGS=-K
|
||||
SHOBJ_LD='ld'
|
||||
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
|
||||
@@ -329,7 +329,7 @@ hpux10*-*gcc*)
|
||||
SHOBJ_LD='${CC}'
|
||||
# if you have problems linking here, moving the `-Wl,+h,$@' from
|
||||
# SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
|
||||
- SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
|
||||
+ SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s'
|
||||
|
||||
SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
|
||||
SHLIB_LIBSUFF='sl'
|
||||
diff --git a/text.c b/text.c
|
||||
index 399a48c..cb2f5ad 100644
|
||||
--- a/text.c
|
||||
+++ b/text.c
|
||||
@@ -857,6 +857,9 @@ _rl_insert_next (count)
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
+ if (c < 0)
|
||||
+ return -1;
|
||||
+
|
||||
#if defined (HANDLE_SIGNALS)
|
||||
if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
|
||||
_rl_restore_tty_signals ();
|
||||
@@ -1520,6 +1523,9 @@ _rl_char_search (count, fdir, bdir)
|
||||
|
||||
mb_len = _rl_read_mbchar (mbchar, MB_LEN_MAX);
|
||||
|
||||
+ if (mb_len <= 0)
|
||||
+ return -1;
|
||||
+
|
||||
if (count < 0)
|
||||
return (_rl_char_search_internal (-count, bdir, mbchar, mb_len));
|
||||
else
|
||||
@@ -1536,6 +1542,9 @@ _rl_char_search (count, fdir, bdir)
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
+ if (c < 0)
|
||||
+ return -1;
|
||||
+
|
||||
if (count < 0)
|
||||
return (_rl_char_search_internal (-count, bdir, c));
|
||||
else
|
||||
diff --git a/vi_mode.c b/vi_mode.c
|
||||
index d0b7e33..b0da0ab 100644
|
||||
--- a/vi_mode.c
|
||||
+++ b/vi_mode.c
|
||||
@@ -886,6 +886,13 @@ rl_vi_domove (key, nextkey)
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
+
|
||||
+ if (c < 0)
|
||||
+ {
|
||||
+ *nextkey = 0;
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
*nextkey = c;
|
||||
|
||||
if (!member (c, vi_motion))
|
||||
@@ -902,6 +909,11 @@ rl_vi_domove (key, nextkey)
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
c = rl_read_key (); /* real command */
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
+ if (c < 0)
|
||||
+ {
|
||||
+ *nextkey = 0;
|
||||
+ return -1;
|
||||
+ }
|
||||
*nextkey = c;
|
||||
}
|
||||
else if (key == c && (key == 'd' || key == 'y' || key == 'c'))
|
||||
@@ -1224,14 +1236,22 @@ static int
|
||||
_rl_vi_callback_char_search (data)
|
||||
_rl_callback_generic_arg *data;
|
||||
{
|
||||
+ int c;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
- _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
|
||||
+ c = _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
|
||||
#else
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
- _rl_vi_last_search_char = rl_read_key ();
|
||||
+ c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
#endif
|
||||
|
||||
+ if (c <= 0)
|
||||
+ return -1;
|
||||
+
|
||||
+#if !defined (HANDLE_MULTIBYTE)
|
||||
+ _rl_vi_last_search_char = c;
|
||||
+#endif
|
||||
+
|
||||
_rl_callback_func = 0;
|
||||
_rl_want_redisplay = 1;
|
||||
|
||||
@@ -1247,6 +1267,7 @@ int
|
||||
rl_vi_char_search (count, key)
|
||||
int count, key;
|
||||
{
|
||||
+ int c;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
static char *target;
|
||||
static int tlen;
|
||||
@@ -1293,11 +1314,17 @@ rl_vi_char_search (count, key)
|
||||
else
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
- _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
|
||||
+ c = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
|
||||
+ if (c <= 0)
|
||||
+ return -1;
|
||||
+ _rl_vi_last_search_mblen = c;
|
||||
#else
|
||||
RL_SETSTATE(RL_STATE_MOREINPUT);
|
||||
- _rl_vi_last_search_char = rl_read_key ();
|
||||
+ c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
+ if (c < 0)
|
||||
+ return -1;
|
||||
+ _rl_vi_last_search_char = c;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1467,6 +1494,9 @@ _rl_vi_callback_getchar (mb, mlen)
|
||||
c = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
+ if (c < 0)
|
||||
+ return -1;
|
||||
+
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
c = _rl_read_mbstring (c, mb, mlen);
|
||||
@@ -1485,6 +1515,9 @@ _rl_vi_callback_change_char (data)
|
||||
|
||||
_rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
|
||||
|
||||
+ if (c < 0)
|
||||
+ return -1;
|
||||
+
|
||||
_rl_callback_func = 0;
|
||||
_rl_want_redisplay = 1;
|
||||
|
||||
@@ -1516,6 +1549,9 @@ rl_vi_change_char (count, key)
|
||||
else
|
||||
_rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
|
||||
|
||||
+ if (c < 0)
|
||||
+ return -1;
|
||||
+
|
||||
return (_rl_vi_change_char (count, c, mb));
|
||||
}
|
||||
|
||||
@@ -1650,7 +1686,7 @@ _rl_vi_set_mark ()
|
||||
ch = rl_read_key ();
|
||||
RL_UNSETSTATE(RL_STATE_MOREINPUT);
|
||||
|
||||
- if (ch < 'a' || ch > 'z')
|
||||
+ if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */
|
||||
{
|
||||
rl_ding ();
|
||||
return -1;
|
||||
@@ -1702,7 +1738,7 @@ _rl_vi_goto_mark ()
|
||||
rl_point = rl_mark;
|
||||
return 0;
|
||||
}
|
||||
- else if (ch < 'a' || ch > 'z')
|
||||
+ else if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */
|
||||
{
|
||||
rl_ding ();
|
||||
return -1;
|
||||
40
packages/tkblt/default.nix
Normal file
40
packages/tkblt/default.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ lib, fetchzip, tcl, tk, xorg }:
|
||||
tcl.mkTclDerivation rec {
|
||||
pname = "tkblt";
|
||||
version = "2.5.3";
|
||||
|
||||
src = fetchzip {
|
||||
url = "http://deb.debian.org/debian/pool/main/b/blt/blt_2.5.3+dfsg.orig.tar.xz";
|
||||
sha256 = "3a9zfTTzOo7HRxAl/6RW8cAxaW/YtnsDb5aV1lyKMVw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./tcl8.6.patch
|
||||
./tk8.6.patch
|
||||
./install.patch
|
||||
./ldflags.patch
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://sourceforge.net/projects/wize/";
|
||||
description = "BLT for Tcl/Tk with patches from Debian";
|
||||
license = lib.licenses.tcltk;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
|
||||
buildInputs = [ tcl tk.dev tk xorg.libX11 xorg.libXext ];
|
||||
|
||||
configureFlags = [
|
||||
"--with-tcl=${tcl}/lib"
|
||||
"--with-tk=${tk}/lib"
|
||||
"--with-tkincls=${tk.dev}/include"
|
||||
"--with-tclincls=${tcl}/include"
|
||||
"--x-includes=${xorg.libXext}/include"
|
||||
"--x-libraries=${xorg.libX11}/lib"
|
||||
];
|
||||
|
||||
preFixup = ''
|
||||
substituteInPlace $out/lib/blt2.5/pkgIndex.tcl --replace 'package ifneeded BLT $version' 'package ifneeded BLT ${version}'
|
||||
'';
|
||||
|
||||
}
|
||||
180
packages/tkblt/install.patch
Normal file
180
packages/tkblt/install.patch
Normal file
@@ -0,0 +1,180 @@
|
||||
Description: Patch fixes installing directories and copying files under
|
||||
INSTALL_ROOT. Also, it adds bltOldConfig.h to the installable headers
|
||||
list and fixes it to include tk.h.
|
||||
Author: Chris Waters and Sergei Golovan
|
||||
Author: Steve Langasek <vorlon@debian.org>
|
||||
Last-Modified: Mon, 31 Aug 2015 12:37:00 -0700
|
||||
|
||||
Index: blt-2.5.3+dfsg/Makefile.in
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/Makefile.in
|
||||
+++ blt-2.5.3+dfsg/Makefile.in
|
||||
@@ -47,9 +47,9 @@
|
||||
(cd library; $(MAKE) install)
|
||||
(cd man; $(MAKE) install)
|
||||
(cd demos; $(MAKE) install)
|
||||
- $(INSTALL_DATA) $(srcdir)/README $(INSTALL_DIR)$(scriptdir)
|
||||
- $(INSTALL_DATA) $(srcdir)/PROBLEMS $(INSTALL_DIR)$(scriptdir)
|
||||
- $(INSTALL_DATA) $(srcdir)/NEWS $(INSTALL_DIR)$(scriptdir)
|
||||
+ $(INSTALL_DATA) $(srcdir)/README $(INSTALL_ROOT)$(scriptdir)
|
||||
+ $(INSTALL_DATA) $(srcdir)/PROBLEMS $(INSTALL_ROOT)$(scriptdir)
|
||||
+ $(INSTALL_DATA) $(srcdir)/NEWS $(INSTALL_ROOT)$(scriptdir)
|
||||
|
||||
mkdirs:
|
||||
@for i in $(instdirs) ; do \
|
||||
@@ -57,7 +57,7 @@
|
||||
: ; \
|
||||
else \
|
||||
echo " mkdir $(INSTALL_ROOT)$$i" ; \
|
||||
- mkdir $(INSTALL_ROOT)$$i ; \
|
||||
+ mkdir -p $(INSTALL_ROOT)$$i ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
@@ -66,10 +66,14 @@
|
||||
(cd library; $(MAKE) clean)
|
||||
(cd man; $(MAKE) clean)
|
||||
(cd demos; $(MAKE) clean)
|
||||
- $(RM) *.bak *\~ "#"* *pure* .pure*
|
||||
+ $(RM) *.bak *\~ "#"* .pure*
|
||||
|
||||
GENERATED_FILES = \
|
||||
config.status config.cache config.log Makefile
|
||||
|
||||
distclean: clean
|
||||
+ (cd generic; $(MAKE) distclean)
|
||||
+ (cd library; $(MAKE) distclean)
|
||||
+ (cd man; $(MAKE) distclean)
|
||||
+ (cd demos; $(MAKE) distclean)
|
||||
$(RM) $(GENERATED_FILES)
|
||||
Index: blt-2.5.3+dfsg/generic/Makefile.in
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/generic/Makefile.in
|
||||
+++ blt-2.5.3+dfsg/generic/Makefile.in
|
||||
@@ -152,6 +152,7 @@
|
||||
$(srcdir)/bltChain.h \
|
||||
bltHash.h \
|
||||
$(srcdir)/bltList.h \
|
||||
+ $(srcdir)/bltOldConfig.h \
|
||||
$(srcdir)/bltPool.h \
|
||||
$(srcdir)/bltTree.h \
|
||||
$(srcdir)/bltDecls.h \
|
||||
@@ -230,7 +231,7 @@
|
||||
: ; \
|
||||
else \
|
||||
echo " mkdir $(INSTALL_ROOT)$$i" ; \
|
||||
- mkdir $(INSTALL_ROOT)$$i ; \
|
||||
+ mkdir -p $(INSTALL_ROOT)$$i ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
@@ -262,7 +263,8 @@
|
||||
|
||||
distclean: clean
|
||||
$(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
|
||||
- $(RM) bltConfig.h Makefile TAGS
|
||||
+ $(RM) bltConfig.h bltHash.h Makefile TAGS
|
||||
+ (cd shared; $(MAKE) distclean)
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CC_SWITCHES) $<
|
||||
Index: blt-2.5.3+dfsg/generic/shared/Makefile.in
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/generic/shared/Makefile.in
|
||||
+++ blt-2.5.3+dfsg/generic/shared/Makefile.in
|
||||
@@ -145,14 +145,20 @@
|
||||
$(srcdir)/bltInit.c
|
||||
$(RM) $@
|
||||
$(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInit.o $(OBJS) \
|
||||
- $(SHLIB_LIB_SPECS)
|
||||
+ $(LIBS)
|
||||
+
|
||||
+# Line above changed for complete dependency listings - gordon
|
||||
+# $(SHLIB_LIB_SPECS)
|
||||
|
||||
$(tcl_only_lib_so): $(TCL_ONLY_OBJS)
|
||||
$(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(scriptdir)\" \
|
||||
$(srcdir)/bltInit.c
|
||||
$(RM) $@
|
||||
$(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInit.o $(TCL_ONLY_OBJS) \
|
||||
- $(SHLIB_TCL_ONLY_LIB_SPECS)
|
||||
+ $(TCL_ONLY_LIB_SPECS)
|
||||
+
|
||||
+# Line above changed for complete dependency listings - gordon
|
||||
+# $(SHLIB_TCL_ONLY_LIB_SPECS)
|
||||
|
||||
install: mkdirs install-lib install-demo
|
||||
|
||||
@@ -175,10 +181,10 @@
|
||||
done
|
||||
clean:
|
||||
$(RM) $(OBJS) $(lib_so) $(tcl_only_lib_so) $(bltwish) $(bltsh) \
|
||||
- *pure* .pure*
|
||||
+ *pure* .pure* bltInit.o
|
||||
|
||||
distclean: clean
|
||||
- $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
|
||||
+ $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"* Makefile
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
# in lieu of viewpath-ing...
|
||||
Index: blt-2.5.3+dfsg/demos/Makefile.in
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/demos/Makefile.in
|
||||
+++ blt-2.5.3+dfsg/demos/Makefile.in
|
||||
@@ -79,7 +79,7 @@
|
||||
: ; \
|
||||
else \
|
||||
echo " mkdir $(INSTALL_ROOT)$$i" ; \
|
||||
- mkdir $(INSTALL_ROOT)"$$i" ; \
|
||||
+ mkdir -p $(INSTALL_ROOT)"$$i" ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
Index: blt-2.5.3+dfsg/man/Makefile.in
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/man/Makefile.in
|
||||
+++ blt-2.5.3+dfsg/man/Makefile.in
|
||||
@@ -52,7 +52,7 @@
|
||||
: ; \
|
||||
else \
|
||||
echo " mkdir $(INSTALL_ROOT)$$i" ; \
|
||||
- mkdir $(INSTALL_ROOT)$$i ; \
|
||||
+ mkdir -p $(INSTALL_ROOT)$$i ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
Index: blt-2.5.3+dfsg/library/Makefile.in
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/library/Makefile.in
|
||||
+++ blt-2.5.3+dfsg/library/Makefile.in
|
||||
@@ -61,7 +61,7 @@
|
||||
for i in $(miscFiles) ; do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$i $(INSTALL_ROOT)$(scriptdir) ; \
|
||||
done
|
||||
- $(INSTALL_DATA) pkgIndex.tcl $(scriptdir)
|
||||
+ $(INSTALL_DATA) pkgIndex.tcl $(INSTALL_ROOT)$(scriptdir)
|
||||
|
||||
mkdirs:
|
||||
@for i in $(instdirs) ; do \
|
||||
@@ -69,7 +69,7 @@
|
||||
: ; \
|
||||
else \
|
||||
echo " mkdir $(INSTALL_ROOT)$$i" ; \
|
||||
- mkdir $(INSTALL_ROOT)$$i ; \
|
||||
+ mkdir -p $(INSTALL_ROOT)$$i ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
Index: blt-2.5.3+dfsg/generic/bltOldConfig.h
|
||||
===================================================================
|
||||
--- blt-2.5.3+dfsg.orig/generic/bltOldConfig.h
|
||||
+++ blt-2.5.3+dfsg/generic/bltOldConfig.h
|
||||
@@ -1,5 +1,7 @@
|
||||
/* Old config headers. */
|
||||
|
||||
+#include <tk.h>
|
||||
+
|
||||
EXTERN int Blt_ConfigureInfo _ANSI_ARGS_((Tcl_Interp * interp,
|
||||
Tk_Window tkwin, Tk_ConfigSpec * specs,
|
||||
char * widgRec, CONST char * argvName,
|
||||
54
packages/tkblt/ldflags.patch
Normal file
54
packages/tkblt/ldflags.patch
Normal file
@@ -0,0 +1,54 @@
|
||||
Description: Patch adds support for externally set LDFLAGS. It lets
|
||||
passing hardening flags from debian/rules. Also, the rpath
|
||||
definition is removed.
|
||||
Author: Sergei Golovan
|
||||
Last-Modified: Fri, 04 Jul 2014 09:29:39 +0400
|
||||
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1061,7 +1061,7 @@
|
||||
SHLIB_LIB_SPECS="${JPEG_LIB_SPEC}"
|
||||
SHLIB_TCL_ONLY_LIB_SPECS="${TCL_ONLY_LIB_SPECS}"
|
||||
SHLIB_TCL_ONLY_LIB_SPECS=""
|
||||
-LDFLAGS=""
|
||||
+LDFLAGS="${LDFLAGS}"
|
||||
LD_RUN_PATH=""
|
||||
EXTRA_LIB_SPECS=""
|
||||
|
||||
@@ -1197,13 +1197,13 @@
|
||||
fi
|
||||
;;
|
||||
|
||||
- *-linux*)
|
||||
+ *-linux*|*-gnu*)
|
||||
SHLIB_CFLAGS="-fPIC"
|
||||
SHLIB_LD="${CC}"
|
||||
SHLIB_LD_FLAGS='-rdynamic -shared -Wl,-E -Wl,-soname,$@'
|
||||
- LD_RUN_PATH="-Wl,-rpath,${loader_run_path}"
|
||||
+ LD_RUN_PATH=""
|
||||
|
||||
- LDFLAGS=""
|
||||
+ LDFLAGS="${LDFLAGS}"
|
||||
EXTRA_LIB_SPECS="-ldl"
|
||||
;;
|
||||
|
||||
--- a/generic/shared/Makefile.in
|
||||
+++ b/generic/shared/Makefile.in
|
||||
@@ -144,7 +144,7 @@
|
||||
$(CC) -c $(CC_SWITCHES) -DBLT_LIBRARY=\"$(scriptdir)\" \
|
||||
$(srcdir)/bltInit.c
|
||||
$(RM) $@
|
||||
- $(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInit.o $(OBJS) \
|
||||
+ $(SHLIB_LD) $(SHLIB_LD_FLAGS) $(LDFLAGS) -o $@ bltInit.o $(OBJS) \
|
||||
$(LIBS)
|
||||
|
||||
# Line above changed for complete dependency listings - gordon
|
||||
@@ -154,7 +154,7 @@
|
||||
$(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(scriptdir)\" \
|
||||
$(srcdir)/bltInit.c
|
||||
$(RM) $@
|
||||
- $(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInit.o $(TCL_ONLY_OBJS) \
|
||||
+ $(SHLIB_LD) $(SHLIB_LD_FLAGS) $(LDFLAGS) -o $@ bltInit.o $(TCL_ONLY_OBJS) \
|
||||
$(TCL_ONLY_LIB_SPECS)
|
||||
|
||||
# Line above changed for complete dependency listings - gordon
|
||||
91
packages/tkblt/tcl8.6.patch
Normal file
91
packages/tkblt/tcl8.6.patch
Normal file
@@ -0,0 +1,91 @@
|
||||
Description: Patch replaces the direct usage of deprecated interp->result
|
||||
by Tcl_SetResult() and Tcl_GetStringResult() calls making it possible
|
||||
to build using Tcl/Tk 8.6.
|
||||
Last-Modified: Fri, 04 Jul 2014 09:20:48 +0400
|
||||
|
||||
--- a/generic/bltScrollbar.c
|
||||
+++ b/generic/bltScrollbar.c
|
||||
@@ -588,7 +588,7 @@
|
||||
} else {
|
||||
fraction = ((double)pixels / (double)barWidth);
|
||||
}
|
||||
- sprintf(interp->result, "%g", fraction);
|
||||
+ sprintf(Tcl_GetStringResult(interp), "%g", fraction);
|
||||
} else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) {
|
||||
int x, y, pos, barWidth;
|
||||
double fraction;
|
||||
--- a/generic/bltTed.c
|
||||
+++ b/generic/bltTed.c
|
||||
@@ -1504,7 +1504,7 @@
|
||||
tablePtr->flags |= ARRANGE_PENDING;
|
||||
Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
|
||||
}
|
||||
- interp->result = Tk_PathName(tedPtr->tkwin);
|
||||
+ Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE);
|
||||
tedPtr->flags |= LAYOUT_PENDING;
|
||||
EventuallyRedraw(tedPtr);
|
||||
return TCL_OK;
|
||||
@@ -1678,7 +1678,7 @@
|
||||
tedPtr->activeRectArr[4].width = grip - 1;
|
||||
tedPtr->activeRectArr[4].height = grip - 1;
|
||||
|
||||
- interp->result = Tk_PathName(entryPtr->tkwin);
|
||||
+ Tcl_SetResult(interp, (char*)Tk_PathName(entryPtr->tkwin), TCL_VOLATILE);
|
||||
active = 1;
|
||||
break;
|
||||
}
|
||||
@@ -1751,7 +1751,7 @@
|
||||
tablePtr->flags |= ARRANGE_PENDING;
|
||||
Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
|
||||
}
|
||||
- interp->result = Tk_PathName(tedPtr->tkwin);
|
||||
+ Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE);
|
||||
tedPtr->flags |= LAYOUT_PENDING;
|
||||
EventuallyRedraw(tedPtr);
|
||||
return TCL_OK;
|
||||
--- a/generic/bltVecMath.c
|
||||
+++ b/generic/bltVecMath.c
|
||||
@@ -834,20 +834,20 @@
|
||||
if ((errno == EDOM) || (value != value)) {
|
||||
Tcl_AppendResult(interp, "domain error: argument not in valid range",
|
||||
(char *)NULL);
|
||||
- Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", interp->result,
|
||||
+ Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", Tcl_GetStringResult(interp),
|
||||
(char *)NULL);
|
||||
} else if ((errno == ERANGE) || IS_INF(value)) {
|
||||
if (value == 0.0) {
|
||||
Tcl_AppendResult(interp,
|
||||
"floating-point value too small to represent",
|
||||
(char *)NULL);
|
||||
- Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", interp->result,
|
||||
+ Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", Tcl_GetStringResult(interp),
|
||||
(char *)NULL);
|
||||
} else {
|
||||
Tcl_AppendResult(interp,
|
||||
"floating-point value too large to represent",
|
||||
(char *)NULL);
|
||||
- Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", interp->result,
|
||||
+ Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", Tcl_GetStringResult(interp),
|
||||
(char *)NULL);
|
||||
}
|
||||
} else {
|
||||
@@ -856,7 +856,7 @@
|
||||
sprintf(buf, "%d", errno);
|
||||
Tcl_AppendResult(interp, "unknown floating-point error, ",
|
||||
"errno = ", buf, (char *)NULL);
|
||||
- Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", interp->result,
|
||||
+ Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", Tcl_GetStringResult(interp),
|
||||
(char *)NULL);
|
||||
}
|
||||
}
|
||||
--- a/generic/bltTreeCmd.c
|
||||
+++ b/generic/bltTreeCmd.c
|
||||
@@ -8560,7 +8560,7 @@
|
||||
if (result == TCL_CONTINUE ) continue;
|
||||
if (result == TCL_ERROR) {
|
||||
Tcl_AppendResult(interp,
|
||||
- "\n (\"tree foreach\" body line ", Blt_Itoa(interp->errorLine), ")\n", 0);
|
||||
+ "\n (\"tree foreach\" body line ", Blt_Itoa(Tcl_GetErrorLine(interp)), ")\n", 0);
|
||||
break;
|
||||
}
|
||||
if (result != TCL_OK) {
|
||||
29
packages/tkblt/tk8.6.patch
Normal file
29
packages/tkblt/tk8.6.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
Description: Patch replaces call to TkCopyAndGlobalEval by a call to
|
||||
Tcl_EvalObjEx because the former function has been dropped in Tk 8.6.
|
||||
Last-Modified: Fri, 04 Jul 2014 09:18:32 +0400
|
||||
|
||||
--- a/generic/tkButton.c
|
||||
+++ b/generic/tkButton.c
|
||||
@@ -864,8 +864,6 @@
|
||||
static Blt_TileChangedProc TileChangedProc;
|
||||
static Tcl_CmdProc ButtonCmd, LabelCmd, CheckbuttonCmd, RadiobuttonCmd;
|
||||
|
||||
-EXTERN int TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp, char *script));
|
||||
-
|
||||
#if (TK_MAJOR_VERSION > 4)
|
||||
EXTERN void TkComputeAnchor _ANSI_ARGS_((Tk_Anchor anchor, Tk_Window tkwin,
|
||||
int padX, int padY, int innerWidth, int innerHeight, int *xPtr,
|
||||
@@ -3292,7 +3290,12 @@
|
||||
}
|
||||
}
|
||||
if ((butPtr->type > TYPE_LABEL) && (butPtr->command != NULL)) {
|
||||
- return TkCopyAndGlobalEval(butPtr->interp, butPtr->command);
|
||||
+ Tcl_DString buf;
|
||||
+ Tcl_DStringInit(&buf);
|
||||
+ Tcl_DStringAppend(&buf, butPtr->command, -1);
|
||||
+ int code = Tcl_EvalEx(butPtr->interp, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), TCL_EVAL_GLOBAL);
|
||||
+ Tcl_DStringFree(&buf);
|
||||
+ return code;
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
35
packages/tkimg/default.nix
Normal file
35
packages/tkimg/default.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ lib, writeText, fetchurl, tcl, tk, tcllib, zlib, libjpeg, libpng, libtiff }:
|
||||
tcl.mkTclDerivation rec {
|
||||
pname = "tkimg";
|
||||
version = "1.4.13";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/tkimg/tkimg/1.4/tkimg%201.4.13/Img-1.4.13-Source.tar.gz";
|
||||
sha256 = "0qyi80f9zwlx8sx9km0d1wfa2d3x846g10ag4gqxqllpmlf8r1ph";
|
||||
};
|
||||
|
||||
# Some platforms encounter runtime errors if compiled with the libs bundled in the source tree
|
||||
# system_libs.patch is a combined set of patches taken from debian allowing compiling with system libs
|
||||
# but hardcodes /usr/include/, this hacky fix sets nix store paths inside the patch
|
||||
patches = with builtins; [ (writeText "fixed_patch" (replaceStrings
|
||||
["/usr/include/zlib.h" "/usr/include/png.h"
|
||||
"/usr/include/jpeglib.h" "/usr/include/jerror.h"]
|
||||
["${zlib.dev}/include/zlib.h" "${libpng.dev}/include/png.h"
|
||||
"${libjpeg.dev}/include/jpeglib.h" "${libjpeg.dev}/include/jerror.h"]
|
||||
(readFile ./system_libs.patch))) ];
|
||||
|
||||
meta = {
|
||||
homepage = "https://sourceforge.net/projects/tkimg/";
|
||||
description = "This package enhances Tk, adding support for many other Image formats: BMP, XBM, XPM, GIF (with transparency, but without LZW), PNG, JPEG, TIFF and postscript.";
|
||||
license = lib.licenses.tcltk;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
|
||||
buildInputs = [ tcl tk.dev tk tcllib zlib.dev zlib libjpeg.dev libjpeg libpng.dev libpng libtiff.dev libtiff];
|
||||
|
||||
configureFlags = [
|
||||
"--with-tcl=${tcl}/lib"
|
||||
"--with-tk=${tk}/lib"
|
||||
"--with-tkinclude=${tk.dev}/include"
|
||||
];
|
||||
}
|
||||
609
packages/tkimg/system_libs.patch
Normal file
609
packages/tkimg/system_libs.patch
Normal file
@@ -0,0 +1,609 @@
|
||||
diff --git a/libjpeg/Makefile.in b/libjpeg/Makefile.in
|
||||
index 021f2b5..9780c04 100755
|
||||
--- a/libjpeg/Makefile.in
|
||||
+++ b/libjpeg/Makefile.in
|
||||
@@ -149,9 +149,9 @@ DEFS = @DEFS@ $(PKG_CFLAGS)
|
||||
CONFIG_CLEAN_FILES = Makefile
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
-LIBS = @PKG_LIBS@ @LIBS@
|
||||
+LIBS = @PKG_LIBS@ @LIBS@ -ljpeg
|
||||
AR = @AR@
|
||||
-CFLAGS = @CFLAGS@ -DJPEGTCLAPI=MODULE_SCOPE -I$(srcdir)/../base
|
||||
+CFLAGS = @CFLAGS@ -DJPEGTCLAPI=MODULE_SCOPE -I$(srcdir)/../base -DMODULE_SCOPE=extern
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
|
||||
#========================================================================
|
||||
diff --git a/libjpeg/configure b/libjpeg/configure
|
||||
index 22f9cdc..4772eed 100755
|
||||
--- a/libjpeg/configure
|
||||
+++ b/libjpeg/configure
|
||||
@@ -5158,60 +5158,6 @@ JPEG_CC=$CC
|
||||
|
||||
|
||||
|
||||
-
|
||||
- vars="
|
||||
- ../compat/libjpeg/jcapimin.c ../compat/libjpeg/jcapistd.c ../compat/libjpeg/jccoefct.c
|
||||
- ../compat/libjpeg/jccolor.c ../compat/libjpeg/jcdctmgr.c ../compat/libjpeg/jchuff.c
|
||||
- ../compat/libjpeg/jcinit.c ../compat/libjpeg/jcmainct.c ../compat/libjpeg/jcmarker.c
|
||||
- ../compat/libjpeg/jcmaster.c ../compat/libjpeg/jcomapi.c ../compat/libjpeg/jcparam.c
|
||||
- ../compat/libjpeg/jcarith.c ../compat/libjpeg/jcprepct.c ../compat/libjpeg/jcsample.c
|
||||
- ../compat/libjpeg/jctrans.c ../compat/libjpeg/jdapimin.c ../compat/libjpeg/jdapistd.c
|
||||
- ../compat/libjpeg/jdatadst.c ../compat/libjpeg/jdatasrc.c ../compat/libjpeg/jdcoefct.c
|
||||
- ../compat/libjpeg/jdcolor.c ../compat/libjpeg/jddctmgr.c ../compat/libjpeg/jdhuff.c
|
||||
- ../compat/libjpeg/jdinput.c ../compat/libjpeg/jdmainct.c ../compat/libjpeg/jdmarker.c
|
||||
- ../compat/libjpeg/jdmaster.c ../compat/libjpeg/jdmerge.c ../compat/libjpeg/jdarith.c
|
||||
- ../compat/libjpeg/jdpostct.c ../compat/libjpeg/jdsample.c ../compat/libjpeg/jdtrans.c
|
||||
- ../compat/libjpeg/jerror.c ../compat/libjpeg/jfdctflt.c ../compat/libjpeg/jfdctfst.c
|
||||
- ../compat/libjpeg/jfdctint.c ../compat/libjpeg/jidctflt.c ../compat/libjpeg/jidctfst.c
|
||||
- ../compat/libjpeg/jidctint.c ../compat/libjpeg/jaricom.c ../compat/libjpeg/jquant1.c
|
||||
- ../compat/libjpeg/jquant2.c ../compat/libjpeg/jutils.c ../compat/libjpeg/jmemmgr.c
|
||||
- ../compat/libjpeg/jmemansi.c
|
||||
-"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
vars="jpegtcl.h jpegtclDecls.h"
|
||||
for i in $vars; do
|
||||
# check for existence, be strict because it is installed
|
||||
diff --git a/libjpeg/configure.ac b/libjpeg/configure.ac
|
||||
index 040b56f..604173a 100755
|
||||
--- a/libjpeg/configure.ac
|
||||
+++ b/libjpeg/configure.ac
|
||||
@@ -53,24 +53,6 @@ JPEG_CC=$CC
|
||||
|
||||
TEA_ADD_SOURCES([jpegtcl.c jpegtclStubInit.c])
|
||||
|
||||
-TEA_ADD_SOURCES([
|
||||
- ../compat/libjpeg/jcapimin.c ../compat/libjpeg/jcapistd.c ../compat/libjpeg/jccoefct.c
|
||||
- ../compat/libjpeg/jccolor.c ../compat/libjpeg/jcdctmgr.c ../compat/libjpeg/jchuff.c
|
||||
- ../compat/libjpeg/jcinit.c ../compat/libjpeg/jcmainct.c ../compat/libjpeg/jcmarker.c
|
||||
- ../compat/libjpeg/jcmaster.c ../compat/libjpeg/jcomapi.c ../compat/libjpeg/jcparam.c
|
||||
- ../compat/libjpeg/jcarith.c ../compat/libjpeg/jcprepct.c ../compat/libjpeg/jcsample.c
|
||||
- ../compat/libjpeg/jctrans.c ../compat/libjpeg/jdapimin.c ../compat/libjpeg/jdapistd.c
|
||||
- ../compat/libjpeg/jdatadst.c ../compat/libjpeg/jdatasrc.c ../compat/libjpeg/jdcoefct.c
|
||||
- ../compat/libjpeg/jdcolor.c ../compat/libjpeg/jddctmgr.c ../compat/libjpeg/jdhuff.c
|
||||
- ../compat/libjpeg/jdinput.c ../compat/libjpeg/jdmainct.c ../compat/libjpeg/jdmarker.c
|
||||
- ../compat/libjpeg/jdmaster.c ../compat/libjpeg/jdmerge.c ../compat/libjpeg/jdarith.c
|
||||
- ../compat/libjpeg/jdpostct.c ../compat/libjpeg/jdsample.c ../compat/libjpeg/jdtrans.c
|
||||
- ../compat/libjpeg/jerror.c ../compat/libjpeg/jfdctflt.c ../compat/libjpeg/jfdctfst.c
|
||||
- ../compat/libjpeg/jfdctint.c ../compat/libjpeg/jidctflt.c ../compat/libjpeg/jidctfst.c
|
||||
- ../compat/libjpeg/jidctint.c ../compat/libjpeg/jaricom.c ../compat/libjpeg/jquant1.c
|
||||
- ../compat/libjpeg/jquant2.c ../compat/libjpeg/jutils.c ../compat/libjpeg/jmemmgr.c
|
||||
- ../compat/libjpeg/jmemansi.c
|
||||
-])
|
||||
|
||||
TEA_ADD_HEADERS([jpegtcl.h jpegtclDecls.h])
|
||||
|
||||
diff --git a/libjpeg/jpegtclDecls.h b/libjpeg/jpegtclDecls.h
|
||||
index bd8decb..3367252 100755
|
||||
--- a/libjpeg/jpegtclDecls.h
|
||||
+++ b/libjpeg/jpegtclDecls.h
|
||||
@@ -30,8 +30,8 @@ EXTERN int Jpegtcl_SafeInit(Tcl_Interp *interp);
|
||||
|
||||
/* undef Tcl macros that conflict with libjpeg stuff (sigh) */
|
||||
#undef EXTERN
|
||||
-#include "../compat/libjpeg/jpeglib.h"
|
||||
-#include "../compat/libjpeg/jerror.h"
|
||||
+#include "/usr/include/jpeglib.h"
|
||||
+#include "/usr/include/jerror.h"
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
diff --git a/libpng/Makefile.in b/libpng/Makefile.in
|
||||
index bdfb68f..6e84f5f 100755
|
||||
--- a/libpng/Makefile.in
|
||||
+++ b/libpng/Makefile.in
|
||||
@@ -153,9 +153,9 @@ DEFS = @DEFS@ $(PKG_CFLAGS)
|
||||
CONFIG_CLEAN_FILES = Makefile
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
-LIBS = @PKG_LIBS@ @LIBS@
|
||||
+LIBS = @PKG_LIBS@ @LIBS@ -lpng16
|
||||
AR = @AR@
|
||||
-CFLAGS = @CFLAGS@ -DPNG_IMPEXP=MODULE_SCOPE -DPNG_EXTERN=MODULE_SCOPE
|
||||
+CFLAGS = @CFLAGS@ -DPNG_IMPEXP= -DPNG_EXTERN=MODULE_SCOPE -DMODULE_SCOPE=extern
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
|
||||
#========================================================================
|
||||
diff --git a/libpng/configure b/libpng/configure
|
||||
index 75cdff5..e35485e 100755
|
||||
--- a/libpng/configure
|
||||
+++ b/libpng/configure
|
||||
@@ -5449,49 +5449,6 @@ fi
|
||||
|
||||
|
||||
|
||||
-
|
||||
- vars="
|
||||
- ../compat/libpng/png.c ../compat/libpng/pngerror.c ../compat/libpng/pngmem.c
|
||||
- ../compat/libpng/pngpread.c ../compat/libpng/pngread.c ../compat/libpng/pngrio.c
|
||||
- ../compat/libpng/pngrtran.c ../compat/libpng/pngrutil.c ../compat/libpng/pngset.c
|
||||
- ../compat/libpng/pngtrans.c ../compat/libpng/pngwio.c ../compat/libpng/pngwrite.c
|
||||
- ../compat/libpng/pngwtran.c ../compat/libpng/pngwutil.c ../compat/libpng/pngget.c
|
||||
-"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
vars="pngtcl.h pngtclDecls.h"
|
||||
for i in $vars; do
|
||||
# check for existence, be strict because it is installed
|
||||
diff --git a/libpng/configure.ac b/libpng/configure.ac
|
||||
index e9a814f..17f38a3 100755
|
||||
--- a/libpng/configure.ac
|
||||
+++ b/libpng/configure.ac
|
||||
@@ -64,14 +64,6 @@ IMG_SRCPATH(zlibtcl)
|
||||
|
||||
TEA_ADD_SOURCES([pngtcl.c pngtclStubInit.c])
|
||||
|
||||
-TEA_ADD_SOURCES([
|
||||
- ../compat/libpng/png.c ../compat/libpng/pngerror.c ../compat/libpng/pngmem.c
|
||||
- ../compat/libpng/pngpread.c ../compat/libpng/pngread.c ../compat/libpng/pngrio.c
|
||||
- ../compat/libpng/pngrtran.c ../compat/libpng/pngrutil.c ../compat/libpng/pngset.c
|
||||
- ../compat/libpng/pngtrans.c ../compat/libpng/pngwio.c ../compat/libpng/pngwrite.c
|
||||
- ../compat/libpng/pngwtran.c ../compat/libpng/pngwutil.c ../compat/libpng/pngget.c
|
||||
-])
|
||||
-
|
||||
TEA_ADD_HEADERS([pngtcl.h pngtclDecls.h])
|
||||
TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${zlibtcl_SRC_PATH}`\"])
|
||||
TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${zlibtcl_BUILD_PATH}`\"])
|
||||
diff --git a/libpng/pngtclDecls.h b/libpng/pngtclDecls.h
|
||||
index 82eb8a4..d394525 100755
|
||||
--- a/libpng/pngtclDecls.h
|
||||
+++ b/libpng/pngtclDecls.h
|
||||
@@ -28,7 +28,9 @@
|
||||
EXTERN int Pngtcl_Init(Tcl_Interp *interp);
|
||||
EXTERN int Pngtcl_SafeInit(Tcl_Interp *interp);
|
||||
|
||||
-#include "../compat/libpng/png.h"
|
||||
+#undef PNG_IMPEXP
|
||||
+#include "/usr/include/png.h"
|
||||
+#define PNG_IMPEXP extern
|
||||
|
||||
/* !BEGIN!: Do not edit below this line. */
|
||||
|
||||
diff --git a/libtiff/Makefile.in b/libtiff/Makefile.in
|
||||
index f6f2664..a0c7006 100755
|
||||
--- a/libtiff/Makefile.in
|
||||
+++ b/libtiff/Makefile.in
|
||||
@@ -151,9 +151,9 @@ DEFS = @DEFS@ $(PKG_CFLAGS)
|
||||
CONFIG_CLEAN_FILES = Makefile
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
-LIBS = @PKG_LIBS@ @LIBS@
|
||||
+LIBS = @PKG_LIBS@ @LIBS@ -ltiff
|
||||
AR = @AR@
|
||||
-CFLAGS = @CFLAGS@ -DTIFFTCLAPI=MODULE_SCOPE
|
||||
+CFLAGS = @CFLAGS@ -DTIFFTCLAPI=MODULE_SCOPE -DMODULE_SCOPE=extern
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
|
||||
#========================================================================
|
||||
diff --git a/libtiff/configure b/libtiff/configure
|
||||
index 03551e3..6e16b5b 100755
|
||||
--- a/libtiff/configure
|
||||
+++ b/libtiff/configure
|
||||
@@ -5298,55 +5298,6 @@ mv -f tifftcl_confdefs.h confdefs.h
|
||||
|
||||
|
||||
|
||||
-
|
||||
- vars="
|
||||
- ../compat/libtiff/libtiff/tif_aux.c ../compat/libtiff/libtiff/tif_close.c ../compat/libtiff/libtiff/tif_codec.c
|
||||
- ../compat/libtiff/libtiff/tif_compress.c ../compat/libtiff/libtiff/tif_dir.c ../compat/libtiff/libtiff/tif_dirinfo.c
|
||||
- ../compat/libtiff/libtiff/tif_dirread.c ../compat/libtiff/libtiff/tif_dirwrite.c ../compat/libtiff/libtiff/tif_dumpmode.c
|
||||
- ../compat/libtiff/libtiff/tif_error.c ../compat/libtiff/libtiff/tif_fax3.c
|
||||
- ../compat/libtiff/libtiff/tif_getimage.c ../compat/libtiff/libtiff/tif_flush.c ../compat/libtiff/libtiff/tif_luv.c
|
||||
- ../compat/libtiff/libtiff/tif_lzw.c ../compat/libtiff/libtiff/tif_next.c ../compat/libtiff/libtiff/tif_open.c
|
||||
- ../compat/libtiff/libtiff/tif_packbits.c ../compat/libtiff/libtiff/tif_predict.c ../compat/libtiff/libtiff/tif_print.c
|
||||
- ../compat/libtiff/libtiff/tif_read.c ../compat/libtiff/libtiff/tif_swab.c ../compat/libtiff/libtiff/tif_strip.c
|
||||
- ../compat/libtiff/libtiff/tif_thunder.c ../compat/libtiff/libtiff/tif_tile.c ../compat/libtiff/libtiff/tif_version.c
|
||||
- ../compat/libtiff/libtiff/tif_warning.c ../compat/libtiff/libtiff/tif_write.c
|
||||
- ../compat/libtiff/libtiff/tif_color.c ../compat/libtiff/libtiff/tif_extension.c
|
||||
-"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
vars="tifftcl.h tifftclDecls.h"
|
||||
for i in $vars; do
|
||||
# check for existence, be strict because it is installed
|
||||
diff --git a/libtiff/configure.ac b/libtiff/configure.ac
|
||||
index aedb2ac..fef474d 100755
|
||||
--- a/libtiff/configure.ac
|
||||
+++ b/libtiff/configure.ac
|
||||
@@ -82,20 +82,6 @@ mv -f tifftcl_confdefs.h confdefs.h
|
||||
|
||||
TEA_ADD_SOURCES([tifftcl.c tifftclStubInit.c])
|
||||
|
||||
-TEA_ADD_SOURCES([
|
||||
- ../compat/libtiff/libtiff/tif_aux.c ../compat/libtiff/libtiff/tif_close.c ../compat/libtiff/libtiff/tif_codec.c
|
||||
- ../compat/libtiff/libtiff/tif_compress.c ../compat/libtiff/libtiff/tif_dir.c ../compat/libtiff/libtiff/tif_dirinfo.c
|
||||
- ../compat/libtiff/libtiff/tif_dirread.c ../compat/libtiff/libtiff/tif_dirwrite.c ../compat/libtiff/libtiff/tif_dumpmode.c
|
||||
- ../compat/libtiff/libtiff/tif_error.c ../compat/libtiff/libtiff/tif_fax3.c
|
||||
- ../compat/libtiff/libtiff/tif_getimage.c ../compat/libtiff/libtiff/tif_flush.c ../compat/libtiff/libtiff/tif_luv.c
|
||||
- ../compat/libtiff/libtiff/tif_lzw.c ../compat/libtiff/libtiff/tif_next.c ../compat/libtiff/libtiff/tif_open.c
|
||||
- ../compat/libtiff/libtiff/tif_packbits.c ../compat/libtiff/libtiff/tif_predict.c ../compat/libtiff/libtiff/tif_print.c
|
||||
- ../compat/libtiff/libtiff/tif_read.c ../compat/libtiff/libtiff/tif_swab.c ../compat/libtiff/libtiff/tif_strip.c
|
||||
- ../compat/libtiff/libtiff/tif_thunder.c ../compat/libtiff/libtiff/tif_tile.c ../compat/libtiff/libtiff/tif_version.c
|
||||
- ../compat/libtiff/libtiff/tif_warning.c ../compat/libtiff/libtiff/tif_write.c
|
||||
- ../compat/libtiff/libtiff/tif_color.c ../compat/libtiff/libtiff/tif_extension.c
|
||||
-])
|
||||
-
|
||||
TEA_ADD_HEADERS([tifftcl.h tifftclDecls.h])
|
||||
TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}`\"])
|
||||
TEA_ADD_INCLUDES([-I\"./libtiff\"])
|
||||
diff --git a/tiff/configure b/tiff/configure
|
||||
index bc6189b..b9d50e3 100755
|
||||
--- a/tiff/configure
|
||||
+++ b/tiff/configure
|
||||
@@ -6270,7 +6270,7 @@ fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
|
||||
- vars="tiff.c tiffJpeg.c tiffZip.c tiffPixar.c"
|
||||
+ vars="tiff.c"
|
||||
for i in $vars; do
|
||||
case $i in
|
||||
\$*)
|
||||
diff --git a/tiff/configure.ac b/tiff/configure.ac
|
||||
index 581908a..5ac8551 100755
|
||||
--- a/tiff/configure.ac
|
||||
+++ b/tiff/configure.ac
|
||||
@@ -75,7 +75,7 @@ IMG_SRCPATH(zlibtcl)
|
||||
# and PKG_TCL_SOURCES.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
-TEA_ADD_SOURCES([tiff.c tiffJpeg.c tiffZip.c tiffPixar.c])
|
||||
+TEA_ADD_SOURCES([tiff.c])
|
||||
TEA_ADD_HEADERS([])
|
||||
TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${srcdir}`\"])
|
||||
TEA_ADD_INCLUDES([-I\"`\${CYGPATH} \${tkimg_SRC_PATH}`\"])
|
||||
diff --git a/tiff/tiff.c b/tiff/tiff.c
|
||||
index 69ab989..4a43bc9 100755
|
||||
--- a/tiff/tiff.c
|
||||
+++ b/tiff/tiff.c
|
||||
@@ -114,14 +114,10 @@ SetupTiffLibrary (Tcl_Interp *interp)
|
||||
if (Zlibtcl_InitStubs(interp, ZLIBTCL_VERSION, 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
- TIFFRegisterCODEC (COMPRESSION_DEFLATE, "Deflate", TkimgTIFFInitZip);
|
||||
- TIFFRegisterCODEC (COMPRESSION_ADOBE_DEFLATE, "AdobeDeflate", TkimgTIFFInitZip);
|
||||
|
||||
if (Jpegtcl_InitStubs(interp, JPEGTCL_VERSION, 0) == NULL) {
|
||||
return TCL_ERROR;
|
||||
}
|
||||
- TIFFRegisterCODEC (COMPRESSION_JPEG, "JPEG", TkimgTIFFInitJpeg);
|
||||
- TIFFRegisterCODEC (COMPRESSION_PIXARLOG, "PixarLog", TkimgTIFFInitPixar);
|
||||
}
|
||||
return TCL_OK;
|
||||
}
|
||||
diff --git a/zlib/Makefile.in b/zlib/Makefile.in
|
||||
index e854470..5e16649 100755
|
||||
--- a/zlib/Makefile.in
|
||||
+++ b/zlib/Makefile.in
|
||||
@@ -149,9 +149,9 @@ DEFS = @DEFS@ $(PKG_CFLAGS)
|
||||
CONFIG_CLEAN_FILES = Makefile
|
||||
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
-LIBS = @PKG_LIBS@ @LIBS@
|
||||
+LIBS = @PKG_LIBS@ @LIBS@ -lz
|
||||
AR = @AR@
|
||||
-CFLAGS = @CFLAGS@ -DZEXTERN=MODULE_SCOPE -DZLIB_CONST
|
||||
+CFLAGS = @CFLAGS@ -DZEXTERN=MODULE_SCOPE -DZLIB_CONST -DMODULE_SCOPE=extern
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
|
||||
#========================================================================
|
||||
diff --git a/zlib/configure b/zlib/configure
|
||||
index c582ba1..e8bff1c 100755
|
||||
--- a/zlib/configure
|
||||
+++ b/zlib/configure
|
||||
@@ -5154,184 +5154,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
|
||||
done
|
||||
|
||||
|
||||
-
|
||||
-
|
||||
- vars="../compat/zlib/adler32.c ../compat/zlib/compress.c ../compat/zlib/crc32.c"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
- vars="../compat/zlib/deflate.c ../compat/zlib/gzclose.c ../compat/zlib/gzlib.c"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
- vars="../compat/zlib/gzread.c ../compat/zlib/gzwrite.c ../compat/zlib/infback.c"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
- vars="../compat/zlib/inffast.c ../compat/zlib/inflate.c ../compat/zlib/inftrees.c"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
- vars="../compat/zlib/trees.c ../compat/zlib/uncompr.c ../compat/zlib/zutil.c"
|
||||
- for i in $vars; do
|
||||
- case $i in
|
||||
- \$*)
|
||||
- # allow $-var names
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $i"
|
||||
- ;;
|
||||
- *)
|
||||
- # check for existence - allows for generic/win/unix VPATH
|
||||
- # To add more dirs here (like 'src'), you have to update VPATH
|
||||
- # in Makefile.in as well
|
||||
- if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \
|
||||
- -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \
|
||||
- -a ! -f "${srcdir}/macosx/$i" \
|
||||
- ; then
|
||||
- as_fn_error $? "could not find source file '$i'" "$LINENO" 5
|
||||
- fi
|
||||
- PKG_SOURCES="$PKG_SOURCES $i"
|
||||
- # this assumes it is in a VPATH dir
|
||||
- i=`basename $i`
|
||||
- # handle user calling this before or after TEA_SETUP_COMPILER
|
||||
- if test x"${OBJEXT}" != x ; then
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}"
|
||||
- else
|
||||
- j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}"
|
||||
- fi
|
||||
- PKG_OBJECTS="$PKG_OBJECTS $j"
|
||||
- ;;
|
||||
- esac
|
||||
- done
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
vars="zlibtcl.h zlibtclDecls.h"
|
||||
for i in $vars; do
|
||||
# check for existence, be strict because it is installed
|
||||
diff --git a/zlib/configure.ac b/zlib/configure.ac
|
||||
index bbc639c..c8c3868 100755
|
||||
--- a/zlib/configure.ac
|
||||
+++ b/zlib/configure.ac
|
||||
@@ -50,11 +50,6 @@ TEA_SETUP_COMPILER
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
TEA_ADD_SOURCES([zlibtcl.c zlibtclStubInit.c])
|
||||
-TEA_ADD_SOURCES([../compat/zlib/adler32.c ../compat/zlib/compress.c ../compat/zlib/crc32.c])
|
||||
-TEA_ADD_SOURCES([../compat/zlib/deflate.c ../compat/zlib/gzclose.c ../compat/zlib/gzlib.c])
|
||||
-TEA_ADD_SOURCES([../compat/zlib/gzread.c ../compat/zlib/gzwrite.c ../compat/zlib/infback.c])
|
||||
-TEA_ADD_SOURCES([../compat/zlib/inffast.c ../compat/zlib/inflate.c ../compat/zlib/inftrees.c])
|
||||
-TEA_ADD_SOURCES([../compat/zlib/trees.c ../compat/zlib/uncompr.c ../compat/zlib/zutil.c])
|
||||
|
||||
TEA_ADD_HEADERS([zlibtcl.h zlibtclDecls.h])
|
||||
|
||||
diff --git a/zlib/zlibtclDecls.h b/zlib/zlibtclDecls.h
|
||||
index c2ebb63..0e75133 100755
|
||||
--- a/zlib/zlibtclDecls.h
|
||||
+++ b/zlib/zlibtclDecls.h
|
||||
@@ -28,7 +28,7 @@
|
||||
EXTERN int Zlibtcl_Init(Tcl_Interp *interp);
|
||||
EXTERN int Zlibtcl_SafeInit(Tcl_Interp *interp);
|
||||
|
||||
-#include "../compat/zlib/zlib.h"
|
||||
+#include "/usr/include/zlib.h"
|
||||
|
||||
#undef gzgetc /* Became a macro in zlib 1.2.7 */
|
||||
|
||||
12
packages/yapps/default.nix
Normal file
12
packages/yapps/default.nix
Normal file
@@ -0,0 +1,12 @@
|
||||
{ fetchFromGitHub, python3Full }:
|
||||
python3Full.pkgs.buildPythonPackage {
|
||||
pname = "yapps";
|
||||
version = "2.2.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "smurfix";
|
||||
repo = "yapps";
|
||||
rev = "67541062093846bb53f011da0f4d489d63375d2d";
|
||||
sha256 = "XDUWuiw6AiUWWHqwSmuU6TfDbK/WRZfBfYgOryBClgI=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user