GithubHelp home page GithubHelp logo

hmage / norm Goto Github PK

View Code? Open in Web Editor NEW
41.0 6.0 5.0 3.51 MB

Rootless installer

Home Page: http://hmage.github.io/norm

License: GNU General Public License v2.0

Shell 100.00%
non-root package-manager shell sysadmin gcc norm compiling compilation

norm's Introduction

NORM — Non-root build Manager

  • Don't have root privileges?
  • Don't want to wait for your sysadmin to install something trivial like new version of midnight commander?
  • Sysadmins don't have new version of gcc or don't know how to install it?

Not a problem!

norm will download, compile and install stuff into a directory in your home folder without requiring superuser access.

Quickstart

git clone https://github.com/hmage/norm ~/norm
echo '[ -f $HOME/norm/.bashrc ] && . $HOME/norm/.bashrc' >> ~/.bashrc
. ~/norm/.bashrc
norm install mc

After waiting a bit, you'll get a fresh version of mc in your $PATH. Just type mc to start using it.

norm places everything it builds into a subdirectory in your home folder.

To prevent problems with NFS-shared homes, it puts system identification in the subdirectory's name, for example on Linux with glibc version 2.19 and Haswell CPU, the name will be norm.x86_64-pc-linux-gnu.2.19.haswell.

How it's done

norm downloads the source code and compiles almost all dependencies. This is to avoid problems when some application (for example aria2) detects that a system has an optional library (for example libpsl) but fails to compile, because the system-provided library is too old.

Please be aware that binaries that norm installs are not portable — the expected paths are usually absolute — just like /usr, but for example in my case it'll be /home/hmage/norm.x86_64-pc-linux-gnu.2.19.haswell.

Moving binaries around will most certainly break them.

Please treat them as your own personal builds (which they are).

Proxies

Since norm uses curl, wget, and aria2c to download, you can use proxies. Just set up the usual environment variables, like this:

export http_proxy=http://192.168.20.99:8080/
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy

Replace the IP address and port number with appropriate values for your proxy. You can add this to your .bashrc if you haven't done so.

Formula format

norm formulae are bash scripts, here's a working example:

#!/bin/bash

fetch_source http://ftpmirror.gnu.org/gzip/gzip-1.12.tar.gz 91fa501ada319c4dc8f796208440d45a3f48ed13

do_unpack_compile

And that's it. It will download, unpack, run ./configure with proper parameters, then make and make install into installation prefix that is located in user's home directory.

More examples

  • norm install ffmpeg — if you're on Ubuntu or Debian, then your ffmpeg version can be either very outdated or not present at all. This will get you the newest ffmpeg with support for x264, x265, webm, opus and fdk-aac.
  • norm install mc — latest midnight commander is much nicer than it was a few years ago.

Adding new formula

To simplify creating the formula, norm provides functions that reduce amount of typing needed for building most software:

  • depends_on — will build the mentioned formulae.
  • fetch_source — downloads the source and verifies checksum.
  • do_unpack_compile — unpacks the source code and builds it.

There are more, but these are the most commonly needed.

If source code uses autotools or cmake, norm detects that and compiles appropriately.

If the build system is something else, or extra steps are needed to successfully build the formula, there are other functions provided, their names and comments should be self explanatory.

To see a more complex example, take a look at how go is built.

Reporting bugs

See https://github.com/hmage/norm/issues.

Also, you can contact me at [email protected].

norm's People

Contributors

coffeepirate avatar hmage avatar igor-ten4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

norm's Issues

the example "master/packages/clang" is no more on page?

example "master/packages/clang" is no more on page?

this is the description

on your website:
https://github.com/hmage/norm
the link in
To see a more complex example, take a look at how clang is built.

how clang is built. -> "https://github.com/hmage/norm/blob/master/packages/clang"

and also in the readme on gh
the link to clang-example https://github.com/hmage/norm/blob/master/packages/clang
seems no longer doesnt work.



anotation:

great tool!

try to use it with jor1k
on 1st try it fails with "Error: your compiler can't compile!"

but it seems it causes by other reason:

bash-4.3$ norm install mc                                                       
Testing if cc compiles '#define _GNU_SOURCE                                     
#include <stdio.h>                                                              
int main() { printf("Hello, world!\n");; return 0;}' ... no                     
[02/Nov/2021:10:24:36 +0000] [norm] Error: your compiler can't compile!         
[02/Nov/2021:10:24:37 +0000] [norm] Check that your have it installed correctly 

bash-4.3$ # so we copy&paste your test-cc-string in a file ts1.cc
bash-4.3$ cat ts1.cc                                                            
#define _GNU_SOURCE                                                             
#include <stdio.h>                                                              
int main() { printf("Hello, world!\n");; return 0;}                             

bash-4.3$ # and now compile with jor1k-onboard gcc, without errors                                     
bash-4.3$ gcc ts1.cc; a.out                                                     
ts1.cc:1:0: warning: "_GNU_SOURCE" redefined                                    
 #define _GNU_SOURCE                                                            
 ^                                                                              
<command-line>:0:0: note: this is the location of the previous definition  
Hello, world!                                                                   
bash-4.3$ 

so I next try to read the c-lang example, like is your suggestion
:)

CU

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.