Skip to content

Instantly share code, notes, and snippets.

@DeltaEvo
Created June 17, 2020 16:19
Show Gist options
  • Save DeltaEvo/0eb3ad65d92f7f0df5e9c3fd346f8005 to your computer and use it in GitHub Desktop.
Save DeltaEvo/0eb3ad65d92f7f0df5e9c3fd346f8005 to your computer and use it in GitHub Desktop.
diff --git a/mlx_init.c b/mlx_init.c
index 7a8db8f..66cdf1b 100644
--- a/mlx_init.c
+++ b/mlx_init.c
@@ -49,24 +49,8 @@ void *mlx_init()
int mlx_int_deal_shm(t_xvar *xvar)
{
- int use_pshm;
- int bidon;
- char *dpy;
- char buff[33];
-
- xvar->use_xshm = XShmQueryVersion(xvar->display,&bidon,&bidon,&(use_pshm));- if (xvar->use_xshm && use_pshm)
- xvar->pshm_format = XShmPixmapFormat(xvar->display);
- else
- xvar->pshm_format = -1;
- gethostname(buff,32);
- dpy = getenv(ENV_DISPLAY);
- if (dpy && strlen(dpy) && *dpy!=':' && strncmp(dpy,buff,strlen(buff)) &&
- strncmp(dpy,LOCALHOST,strlen(LOCALHOST)) )
- {
- xvar->pshm_format = -1;
- xvar->use_xshm = 0;
- }
+ xvar->pshm_format = -1;
+ xvar->use_xshm = 0;
}
/*
{ stdenv, fetchurl, pkgconfig, libX11, libXext }:
stdenv.mkDerivation rec {
name = "minilibx-${version}";
version = "0.42";
src = fetchurl {
url = "https://projects.intra.42.fr/uploads/document/document/7/sources.tgz";
sha256 = "1lwa9n1jrp2r157bls8vq5xblqs2dx2nhj0yly7p2jzz7mwk3njw";
};
nativeBuildInputs = [ pkgconfig libX11 libXext ];
configurePhase = ''
echo "INC=. \''${shell pkg-config --cflags x11 xext}" > Makefile
cat Makefile.mk | grep -v %%%% >> Makefile
cat Makefile
'';
patches = [
./disable_xshm_image.patch
];
installPhase = ''
mkdir -p $out/include
mkdir -p $out/lib
install -m 644 libmlx.a $out/lib
install -m 644 mlx.h $out/include
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment