Re: How to run guix on replicant / android with linux 3.0?

2019-02-16 Thread Julien Lepiller
Le 16 février 2019 22:51:08 GMT+01:00, Alex Vong  a 
écrit :
>Hello,
>
>I've a phone with replicant installed. It runs linux 3.0.x which is too
>old for guix glibc (which requires linux 3.2.x). Using the hint at the
>bottom of 'cross-base.scm', I successfully build cross-gcc with
>cross-glibc 2.23 (configured with '--enable-kernel=3.0.0') for
>armhf. Using them, I can cross-compile a statically linked hello world.
>
>Is there an easy way to make relocatable guix pack with glibc 2.23
>(configured with '--enable-kernel=3.0.0') for armhf? (My phone doesn't
>connect to the internet, so I can't use 'guix pull' and 'guix
>manifest'.) Right now, I have to manually set the '-B', '-I', '-L' and
>'-sysroot' paths to cross-gcc to make it build hello world (which is
>wrong and very tedious).
>
>The snippet is copied below for reference, but please don't use it,
>it's
>only a proof-of-concept. Thanks for help!
>
>Cheers,
>Alex
>
>
>(use-modules (guix packages)
> (guix utils)
> (gnu packages)
> (gnu packages base)
> (gnu packages cross-base))
>
>
>(let* ((triplet "arm-linux-gnueabihf")
>
>  (cross-linux (@@ (gnu packages cross-base) cross-kernel-headers))
>   (cross-linux* (cross-linux triplet))
>
>   (cross-binutils* (cross-binutils triplet))
>   
>   (cross-glibc (cross-libc triplet))
>   (cross-glibc-version "2.23")
>
>   (cross-glibc*
>(package
>  (inherit cross-glibc)
>  (version cross-glibc-version)
>  (source (origin
>(inherit (package-source glibc))
>(uri (string-append "mirror://gnu/glibc/glibc-"
>cross-glibc-version ".tar.xz"))
>(sha256
> (base32
>   "1s8krs3y2n6pzav7ic59dz41alqalphv7vww4138ag30wh0fpvwl"))
>(patches
> (search-patches "glibc-ldd-x86_64.patch"
> "glibc-versioned-locpath.patch"
>"glibc-vectorized-strcspn-guards.patch"
> "glibc-CVE-2015-5180.patch"
> "glibc-CVE-2016-3075.patch"
> "glibc-CVE-2016-3706.patch"
> "glibc-CVE-2016-4429.patch"
> "glibc-CVE-2017-1000366-pt1.patch"
> "glibc-CVE-2017-1000366-pt2.patch"
>   "glibc-CVE-2017-1000366-pt3.patch"))
>(modules '((guix build utils)))
>  (snippet
>   '(begin
>  (substitute* "misc/regexp.c"
>(("char \\*loc1;")
>  "char *loc1 __attribute__ ((nocommon));")
>(("char \\*loc2;")
>  "char *loc2 __attribute__ ((nocommon));")
>(("char \\*locs;")
> "char *locs __attribute__ ((nocommon));"))
>  #t
>  (arguments
>   (substitute-keyword-arguments
>   (package-arguments cross-glibc)
> ((#:configure-flags flags)
>  `(append ,flags (list "--enable-kernel=3.0.0")))
>
>   (cross-gcc* (cross-gcc triplet
>  #:xbinutils (cross-binutils triplet)
>  #:libc cross-glibc*)))
>
>  (list cross-linux* cross-binutils* cross-glibc* cross-gcc*))

Hi,

I think I read somewhere (in the manual?) that you need a kernel 3.19 or 
greater to be able to use a relocatable guix pack. Since you're root on your 
phone though, you should be able to use a normal pack.

Maybe with inferiors you can use an older version of guix that works with your 
kernel?



Re: pdf editor for placing stress

2019-02-16 Thread Ricardo Wurmus


zna...@tutanota.com writes:

> Hello, GuixSD! Is there any software for placing stress and some other
> notes on text inf pdf files for files with lot of pages?  GIMP is bad
> when you need 50 page you must make invisible other layers.

I use Xournal for annotating PDF documents.

--
Ricardo




How to run guix on replicant / android with linux 3.0?

2019-02-16 Thread Alex Vong
Hello,

I've a phone with replicant installed. It runs linux 3.0.x which is too
old for guix glibc (which requires linux 3.2.x). Using the hint at the
bottom of 'cross-base.scm', I successfully build cross-gcc with
cross-glibc 2.23 (configured with '--enable-kernel=3.0.0') for
armhf. Using them, I can cross-compile a statically linked hello world.

Is there an easy way to make relocatable guix pack with glibc 2.23
(configured with '--enable-kernel=3.0.0') for armhf? (My phone doesn't
connect to the internet, so I can't use 'guix pull' and 'guix
manifest'.) Right now, I have to manually set the '-B', '-I', '-L' and
'-sysroot' paths to cross-gcc to make it build hello world (which is
wrong and very tedious).

The snippet is copied below for reference, but please don't use it, it's
only a proof-of-concept. Thanks for help!

Cheers,
Alex


(use-modules (guix packages)
 (guix utils)
 (gnu packages)
 (gnu packages base)
 (gnu packages cross-base))


(let* ((triplet "arm-linux-gnueabihf")

   (cross-linux (@@ (gnu packages cross-base) cross-kernel-headers))
   (cross-linux* (cross-linux triplet))

   (cross-binutils* (cross-binutils triplet))
   
   (cross-glibc (cross-libc triplet))
   (cross-glibc-version "2.23")

   (cross-glibc*
(package
  (inherit cross-glibc)
  (version cross-glibc-version)
  (source (origin
(inherit (package-source glibc))
(uri (string-append "mirror://gnu/glibc/glibc-"
cross-glibc-version ".tar.xz"))
(sha256
 (base32
  "1s8krs3y2n6pzav7ic59dz41alqalphv7vww4138ag30wh0fpvwl"))
(patches
 (search-patches "glibc-ldd-x86_64.patch"
 "glibc-versioned-locpath.patch"
 "glibc-vectorized-strcspn-guards.patch"
 "glibc-CVE-2015-5180.patch"
 "glibc-CVE-2016-3075.patch"
 "glibc-CVE-2016-3706.patch"
 "glibc-CVE-2016-4429.patch"
 "glibc-CVE-2017-1000366-pt1.patch"
 "glibc-CVE-2017-1000366-pt2.patch"
 "glibc-CVE-2017-1000366-pt3.patch"))
(modules '((guix build utils)))
  (snippet
   '(begin
  (substitute* "misc/regexp.c"
(("char \\*loc1;")
 "char *loc1 __attribute__ 
((nocommon));")
(("char \\*loc2;")
 "char *loc2 __attribute__ 
((nocommon));")
(("char \\*locs;")
 "char *locs __attribute__ 
((nocommon));"))
  #t
  (arguments
   (substitute-keyword-arguments
   (package-arguments cross-glibc)
 ((#:configure-flags flags)
  `(append ,flags (list "--enable-kernel=3.0.0")))

   (cross-gcc* (cross-gcc triplet
  #:xbinutils (cross-binutils triplet)
  #:libc cross-glibc*)))

  (list cross-linux* cross-binutils* cross-glibc* cross-gcc*))


signature.asc
Description: PGP signature


Re: pdf editor for placing stress

2019-02-16 Thread Benjamin Slade
Hi znavko,

On 2019-02-16T09:21:26-0700, zna...@tutanota.com wrote:
 > Hello, GuixSD! Is there any software for placing stress and some other notes 
 > on text inf pdf files for files with lot of pages?
 > GIMP is bad when you need 50 page you must make invisible other layers.

pdf-tools is pretty good for this sort of thing:
https://github.com/politza/pdf-tools

as an alternative (or complementary) approach, you could use:

interleave: https://github.com/rudolfochrist/interleave

or

org-noter: https://github.com/weirdNox/org-noter

to have synchronised text notes for pdfs.


-- 
Benjamin Slade - https://babbagefiles.xyz
  `(pgp_fp: ,(21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19))
'(sent by mu4e on Emacs running under GNU/Linux . https://gnu.org )
   `(Choose Linux ,(Choose Freedom) . https://linux.com )



Re: pdf editor for placing stress

2019-02-16 Thread sirgazil

Hi znavko,

El 16/02/19 a las 11:21 a. m., zna...@tutanota.com escribió:
Hello, GuixSD! Is there any software for placing stress and some other 
notes on text inf pdf files for files with lot of pages?

GIMP is bad when you need 50 page you must make invisible other layers.


Evince lets you highlight text and add notes to PDF documents.


--
Luis Felipe López Acevedo
http://sirgazil.bitbucket.io/





Re: Need help porting eDuke32

2019-02-16 Thread Marius Bakke
Hello,

HiPhish  writes:

> Then it fails at this step:
>
> In file included from source/build/include/mutex.h:10:0,
>  from source/build/include/osd.h:12,
>  from source/build/include/baselayer.h:11,
>  from source/duke3d/src/duke3d.h:28,
>  from source/duke3d/src/sdlmusic.cpp:35:
> source/build/include/sdl_inc.h:63:25: fatal error: SDL_mixer.h: No such 
> file or directory
> compilation terminated.
> Failed building obj/duke3d/sdlmusic.o from source/duke3d/src/sdlmusic.cpp!
> make: *** [GNUmakefile:982: obj/duke3d/sdlmusic.o] Error 1
>
> Looking into the offending file shows the following code:
>
> #if defined NEED_SDL_MIXER
>
> # if defined SDL_USEFOLDER
> #  if SDL_TARGET == 2
> #   include 
> #  else
> #   include 
> #  endif
> # else
> #  include "SDL_mixer.h"
> # endif
>
> The second-to-last line is line 63; the compiler looks for the header file in 
> the same directory as the source file, which is obviously wrong. So it seems 
> like my environment specification did not set up SDL properly. Can someone 
> who 
> has experience with SDL please help me out to understand what is going wrong 
> here?

The 'include' keyword makes the compiler look for header files in
$C_INCLUDE_PATH and a few other locations.  The Guix daemon will populate
that variable with all inputs that have an "include" directory.  Running
`guix build sdl2-mixer` shows that it has ".../include/SDL2/SDL_mixer.h".

What's needed here is to make sure SDL_USEFOLDER is set such that it
searches for  as on line 58.  Alternatively, you could
substitute the code on line 63 to read 'include "SDL2/SDL_mixer.h"' as a
probably dirty workaround.

HTH!


signature.asc
Description: PGP signature


pdf editor for placing stress

2019-02-16 Thread znavko
Hello, GuixSD! Is there any software for placing stress and some other notes on 
text inf pdf files for files with lot of pages?
GIMP is bad when you need 50 page you must make invisible other layers.


Building and installing packages with modifications

2019-02-16 Thread 白い熊
Hi Guix: 

This is a question derived from my current trouble with running Guix on 
Android, as seen in: 
http://lists.gnu.org/archive/html/help-guix/2019-02/msg00151.html

Basically: 
— I have Guix running on an armhf Android phone 
— “guix pull” won't complete as it needs to build curl locally, since a 
substitute is unavailable 
— curl local build fails on checking internet connection in one of its tests, 
as is common, as I found out on the web 
— Thus “guix pull” never finishes, and I can't install any packages etc, since 
even without pulling a new version, they also fall into building curl 

I'd like to overcome this, am not sufficiently advanced in Guix, so would like 
to receive ideas / tips on how to best / easiest do this. 

Currently, I'm thinking of two options. 

① Build curl locally, without the failing tests. 
② Install an older substitute version of curl already built. 

Ad ①: 
— I've found there is an environment variable (INTERNET_TEST or something) you 
can set so the test is not run during auto build run. It's ignored if “guix 
build curl” is run with it. 
— Can environment variables be passed to “guix build” so they are then honored 
during build? 
— If not, can I instruct “guix build” to not run “make test”? 
— If both not, can I then carry out the individual stages of a package build in 
Guix, so I can skip the test phase? 
— If I build it in any of these ways, will “guix package -i curl” then install 
this version in the profile? 
— If not, can I install it any other way then, so I can commence with “guix 
pull” without it being rebuilt? 

Ad ②: 
— Is there any way I can search the substitute servers for the latest built 
substitute of a package? 
— How can I then install it? 

If none of these, is there another way to overcome my problem? 

Many thanks for any advice! :@) 
--
白い熊



Re: Need help porting eDuke32

2019-02-16 Thread Pierre Neidhardt

> OK, some places prefer links if the logs get too large. I'll keep it in mind 
> for this mailing list.

I meant paste a link to the whole build log! :)

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: Need help porting eDuke32

2019-02-16 Thread nee
Hello thank you for packaging eDuke32!

I recently had a similar problem with a SDL package and solved it like this:

(arguments '(#:phases
 (modify-phases %standard-phases
   (add-before 'build 'fix-env
 (lambda* (#:key inputs #:allow-other-keys)
   (setenv "CPATH" (string-append (assoc-ref inputs
"sdl-union")
  "/include/SDL/"))
   #t)

That should also work in your case if you want to get quickly by the
issue and solve other problems.

But like the first reply said, in your case it would probably be cleaner
to pass SDL_USEFOLDER to Make via make-flags and then have it be passed
from Make to gcc, but I would have to look at the makefile first.

>Can someone who has experience with SDL please help me out to
understand what is going wrong here?

I think the general problem exists because in the past some distros
installed SDL headers without the SDL/ prefix leaving game makers
uncertain how to include it.

In the C file you posted the C compiler checks if there is a #define for
SDL_USEFOLDER. Depening on the defines it will look for SDL_mixer.h in a
different location (SDL/SDL_mixer.h SDL2/SDL_mixer.h or SDL_mixer.h).

Defines can either be set in c code via #define X 1
or in the gcc compiler call via `gcc test.c -DX=1`.
gcc is called from make. Usually there are make-flag variables like
CFLAGS or DEFINES that are expanded into the arguments that gcc will be
called with. They can be set with (arguments (#:make-flags
'(DEFINES=-DX=1)))
Often Makefiles are generated by configure files (GNU autotools) and
configure will insert the defines based on the configure-flags it was
called with. You would set that via something like
(arguments (#:make-flags '(--use-sdl-folders)))

C includes will be looked up in the directories of the C_INLUDE_PATH or
CPATH Shell Environment Variables. When there is an #include 
and the CPATH is /usr/local/include:/some/include/ and neither
/usr/local/include/file.h nor /some/include exist you get the error
message that you posted.

I hope some of that is understandable and helps you out.
Happy hacking!



Re: How to start Xorg server with startx

2019-02-16 Thread Yoshinori Arai
Thank you for your pointer.

Unfortunately I have already uninstalled xorg-server, xinit. I can't try it 
soon.

I have another problem for LXDE and LXQT with slim login manager.
I'm using uim-anthy for japanese input but slim can't read xprofile so
I use xsession script to set environment variable such as XMODIFIER,
GTK_IM_MODULE.

I can select desktop with slim but can't use uim-anthy without xsession.

Also I did system reconfigure to install LXDE, LXQT. Its package field
is as follows,

  (packages (cons* fluxbox cwm;window managers
   lxde lxqt  ;desktop
   nss-certs  ;for HTTPS access
   %base-packages))

There are many desktop file in
/run/current-system/profile/share/xsessions.

LXDE.desktop  fluxbox.desktop  openbox-gnome.desktop  openbox.desktop
cwm.desktop   lxqt.desktop openbox-kde.desktop

This is not problem but wonder a little.



Re: Need help porting eDuke32

2019-02-16 Thread Pierre Neidhardt
Hi HiPhish!

I'm also interested in packaging this!
I'll give it a closer look real soon if you are stuck.

> https://pastebin.com/FyJKK6BD

It's better if you paste the whole build log.

In the guix environment, inspect the C_INCLUDE_PATH variable (e.g. "env | grep
C_INCLUDE_PATH"), check if sdl2-mixer is in there.

Otherwise try passing "-DSDL_TARGET=2" to the #:make-flags, that could do it.
  

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Need help porting eDuke32

2019-02-16 Thread HiPhish
Hello everyone,

I have been trying to build eDuke32[1] (a Free source port of Duke Nukem 3D) 
with Guix following their instructions[2], but it looks like I am unable to 
set up the environment properly. I first created the following Guile script 
(omitting some version, source, description and synopsis for brevity):

(define-public eduke32
  (package
(name "eduke32")
(build-system gnu-build-system)
(arguments `())
(native-inputs
  `(("pkg-config" ,pkg-config)))
(inputs
  `(("sdl-union" ,(sdl-union (list sdl2 sdl2-mixer)))
("glu" ,glu)
("libvorbis" ,libvorbis)
("libvpx" ,libvpx)
("flac" ,flac)
("gtk+" ,gtk+-2)

Then I typed `guix environment --load=eduke32.scm` in my shell to set up the 
build environment, and executed `make`. This works at first, it builds the 
following files:

https://pastebin.com/FyJKK6BD

Then it fails at this step:

In file included from source/build/include/mutex.h:10:0,
 from source/build/include/osd.h:12,
 from source/build/include/baselayer.h:11,
 from source/duke3d/src/duke3d.h:28,
 from source/duke3d/src/sdlmusic.cpp:35:
source/build/include/sdl_inc.h:63:25: fatal error: SDL_mixer.h: No such 
file or directory
compilation terminated.
Failed building obj/duke3d/sdlmusic.o from source/duke3d/src/sdlmusic.cpp!
make: *** [GNUmakefile:982: obj/duke3d/sdlmusic.o] Error 1

Looking into the offending file shows the following code:

#if defined NEED_SDL_MIXER

# if defined SDL_USEFOLDER
#  if SDL_TARGET == 2
#   include 
#  else
#   include 
#  endif
# else
#  include "SDL_mixer.h"
# endif

The second-to-last line is line 63; the compiler looks for the header file in 
the same directory as the source file, which is obviously wrong. So it seems 
like my environment specification did not set up SDL properly. Can someone who 
has experience with SDL please help me out to understand what is going wrong 
here?


[1] http://eduke32.com/
[2] https://wiki.eduke32.com/wiki/Building_EDuke32_on_Linux