Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ######################################
- # requires alsa-lib-1.0.25.tar.bz2 #
- ######################################
- python3 <<EOF
- #!/usr/bin/env python3
- import sys
- sys.dont_write_bytecode = True
- import os
- import subprocess
- def main():
- opsys = shell("uname -s").lower()
- if opsys == "darwin": os._exit(0) # MacOS, no problem
- whereis = shell("whereis libasound").lower()
- items = whereis.split(" ")
- for item in items:
- if not "." in item: continue
- extension = item.split(".")[1]
- if extension == "a": os._exit(0) # libasound.a found
- os._exit(1)
- def shell(command):
- return subprocess.run(
- command.split(" ")
- ,stdout=subprocess.PIPE
- ).stdout.decode("utf-8").strip()
- main()
- EOF
- if [ $? -eq 0 ]; then
- exit
- fi
- DIR=$(dirname "${BASH_SOURCE[0]}")
- DIR=$(realpath "${DIR}")
- cd $DIR
- rm -rf cd alsa-lib-1.0.25
- tar xvf alsa-lib-1.0.25.tar.bz2
- cd alsa-lib-1.0.25
- ./configure --disable-shared --enable-static
- make -j4
- echo password required for sudo make install
- sudo make install
Add Comment
Please, Sign In to add comment